Переглянути джерело

fix(init): fix pub_access rule for fw3

Signed-off-by: Tianling Shen <[email protected]>
Tianling Shen 2 роки тому
батько
коміт
bc654b7bae
1 змінених файлів з 8 додано та 8 видалено
  1. 8 8
      root/etc/init.d/unblockneteasemusic

+ 8 - 8
root/etc/init.d/unblockneteasemusic

@@ -13,7 +13,7 @@ UNM_DIR="/usr/share/$NAME"
 RUN_DIR="/var/run/$NAME"
 
 IPT_N="iptables -t nat"
-IPT_INPUT_RULE="unblockneteasemusic_input_rule"
+IPT_INPUT_RULE="unm_input_rule"
 FW4="$(command -v fw4)"
 
 is_enabled() {
@@ -115,10 +115,10 @@ start_service() {
 		json_add_string hijack_ways "${hijack_ways}"
 	else
 		if is_enabled "config" "pub_access"; then
-			iptables -N "$IPT_RULE_NAME"
-			iptables -t filter -I INPUT -j "$IPT_RULE_NAME"
-			iptables -t filter -A "$IPT_RULE_NAME" -p tcp --dport "${http_port}" -j ACCEPT
-			iptables -t filter -A "$IPT_RULE_NAME" -p tcp --dport "${https_port}" -j ACCEPT
+			iptables -N "$IPT_INPUT_RULE"
+			iptables -t filter -I INPUT -j "$IPT_INPUT_RULE"
+			iptables -t filter -A "$IPT_INPUT_RULE" -p tcp --dport "${http_port}" -j ACCEPT
+			iptables -t filter -A "$IPT_INPUT_RULE" -p tcp --dport "${https_port}" -j ACCEPT
 
 			echo "/etc/init.d/$NAME restart" > "$RUN_DIR/fw3.include"
 		fi
@@ -288,9 +288,9 @@ stop_service() {
 		rm -f "$RUN_DIR/fw4.info"
 		echo > "$RUN_DIR/fw4.nft"
 	else
-		iptables -t filter -D INPUT -j "$IPT_RULE_NAME" 2>"/dev/null"
-		iptables -F "$IPT_RULE_NAME" 2>"/dev/null"
-		iptables -X "$IPT_RULE_NAME" 2>"/dev/null"
+		iptables -t filter -D INPUT -j "$IPT_INPUT_RULE" 2>"/dev/null"
+		iptables -F "$IPT_INPUT_RULE" 2>"/dev/null"
+		iptables -X "$IPT_INPUT_RULE" 2>"/dev/null"
 
 		$IPT_N -D "PREROUTING" -p "tcp" -m set --match-set "neteasemusic" "dst" -j "netease_cloud_music" 2>"/dev/null"
 		$IPT_N -F "netease_cloud_music" 2>"/dev/null"