Commit af777ae 1 parent fdeaf0f commit af777ae Copy full SHA for af777ae
File tree 2 files changed +11
-4
lines changed
2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,9 @@ ipfw -q -f flush add
11
11
${cmd} 00193 deny all from any to any uid ${user}
12
12
13
13
# Get the tunnel id dynamically
14
- vpn=" $( ifconfig | grep -v " groups" | grep " tun" | cut -d " :" -f1 | head -n 1) "
14
+ vpn=" $( ifconfig | grep -v " groups" | grep " tun" | cut -d " :" -f1 | tail -n 1) "
15
15
while [ -z " ${vpn} " ] && [ " ${try:= " 0" } " -le " 20" ]; do
16
- vpn=" $( ifconfig | grep -v " groups" | grep " tun" | cut -d " :" -f1 | head -n 1) "
16
+ vpn=" $( ifconfig | grep -v " groups" | grep " tun" | cut -d " :" -f1 | tail -n 1) "
17
17
try=" $(( try + 1 )) "
18
18
sleep 3
19
19
done
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ vpnUser="transmission"
25
25
vpnDir=" /usr/local/etc/openvpn"
26
26
tempDir=" /tmp/piaPort"
27
27
curlMaxTime=" 15"
28
+ firewallScript=" /mnt/scripts/trans/ipfw.rules"
28
29
payloadFile=" ${tempDir} /payload.sig"
29
30
passFile=" ${vpnDir} /pass.txt"
30
31
@@ -62,15 +63,21 @@ function VPN_Status() {
62
63
# set adaptorName
63
64
# Config
64
65
local tunnelAdapter
66
+ local tunnelAdapters
65
67
local try
66
68
67
- tunnelAdapter=" $( ifconfig | grep -v " groups" | grep " tun" | cut -d " :" -f1) "
69
+ tunnelAdapter=" $( ifconfig | grep -v " groups" | grep " tun" | cut -d " :" -f1 | tail -n 1 ) "
68
70
while [ -z " ${tunnelAdapter} " ] && [ " ${try:= 0} " -le " 20" ]; do
69
- tunnelAdapter=" $( ifconfig | grep -v " groups" | grep " tun" | cut -d " :" -f1) "
71
+ tunnelAdapter=" $( ifconfig | grep -v " groups" | grep " tun" | cut -d " :" -f1 | tail -n 1 ) "
70
72
try=" $(( try + 1 )) "
71
73
sleep 3
72
74
done
73
75
76
+ readarray -t tunnelAdapters <<< " $(ifconfig | grep -v " groups" | grep " tun" | cut -d " :" -f1)"
77
+ if [ " ${# tunnelAdapters[@]} " -gt " 1" ]; then
78
+ ${firewallScript}
79
+ fi
80
+
74
81
if [ -z " ${tunnelAdapter} " ]; then
75
82
return 1
76
83
else
You can’t perform that action at this time.
0 commit comments