This repository was archived by the owner on Mar 16, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -110,15 +110,18 @@ if [ "$KILL_SWITCH" = "on" ]; then
110
110
# strip any comments from line that could mess up cuts
111
111
clean_line=${line%% #* }
112
112
addr=$( echo " $clean_line " | cut -d " " -f 1)
113
- port=$( echo " $clean_line " | cut -d " " -f 2)
114
- proto=$( echo " $clean_line " | cut -d " " -f 3 | cut -c1-3)
113
+ port=$( echo " $clean_line " | cut -s -d " " -f 2)
114
+ proto=$( echo " $clean_line " | cut -s -d " " -f 3 | cut -c1-3)
115
+ port=${port:- ${remote_port:- 1194} }
116
+ proto=${proto:- ${remote_proto:- udp} }
117
+
115
118
if is_ip " $addr " ; then
116
- echo " IP: $addr PORT: $port "
117
- iptables -A OUTPUT -o eth0 -d " $addr " -p " ${proto:- $remote_proto } " --dport " ${port:- $remote_port } " -j ACCEPT
119
+ echo " IP: $addr PORT: $port PROTO: $proto "
120
+ iptables -A OUTPUT -o eth0 -d " $addr " -p " ${proto} " --dport " ${port} " -j ACCEPT
118
121
else
119
122
for ip in $( dig -4 +short " $addr " ) ; do
120
- echo " $addr (IP: $ip PORT: $port )"
121
- iptables -A OUTPUT -o eth0 -d " $ip " -p " ${proto:- $remote_proto } " --dport " ${port:- $remote_port } " -j ACCEPT
123
+ echo " $addr (IP: $ip PORT: $port PROTO: $proto )"
124
+ iptables -A OUTPUT -o eth0 -d " $ip " -p " ${proto} " --dport " ${port} " -j ACCEPT
122
125
done
123
126
fi
124
127
done
You can’t perform that action at this time.
0 commit comments