Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Jrohy committed Dec 2, 2020
1 parent 56bde07 commit f5d52c5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions v2ray_util/util_core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def clean_iptables(port):
os.system("{}-save -c > /etc/sysconfig/iptables".format(iptable_way))
os.system(firewall_clean_cmd.format(str(port), str(port)))
os.system("firewall-cmd --reload >/dev/null 2>&1")
os.system("{}-restore -c > /etc/sysconfig/iptables".format(iptable_way))
os.system("{}-restore -c < /etc/sysconfig/iptables".format(iptable_way))
input_result = os.popen(check_cmd % (iptable_way, "INPUT", str(port))).readlines()
for line in input_result:
os.system(clean_cmd.format(iptable_way, "INPUT", str(line)))
Expand Down Expand Up @@ -272,7 +272,7 @@ def open_port(openport=-1):
os.system("{}-save -c > /etc/sysconfig/iptables".format(iptable_way))
os.system(firewall_open_cmd.format(port_str, port_str))
os.system("firewall-cmd --reload >/dev/null 2>&1")
os.system("{}-restore -c > /etc/sysconfig/iptables".format(iptable_way))
os.system("{}-restore -c < /etc/sysconfig/iptables".format(iptable_way))
else:
iptables_open(iptable_way, port_str)
else:
Expand All @@ -281,7 +281,7 @@ def open_port(openport=-1):
for port in port_set:
os.system(firewall_open_cmd.format(str(port), str(port)))
os.system("firewall-cmd --reload >/dev/null 2>&1")
os.system("{}-restore -c > /etc/sysconfig/iptables".format(iptable_way))
os.system("{}-restore -c < /etc/sysconfig/iptables".format(iptable_way))
for port in port_set:
iptables_open(iptable_way, str(port))

Expand Down

0 comments on commit f5d52c5

Please sign in to comment.