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
110110 # strip any comments from line that could mess up cuts
111111 clean_line=${line%% #* }
112112 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+
115118 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
118121 else
119122 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
122125 done
123126 fi
124127 done
You can’t perform that action at this time.
0 commit comments