@@ -28,23 +28,18 @@ if [ -z "$(grep "^ \{0,\}tun:" $CONFIG_YAML)" ] || [ -z "$(grep "^ \{0,\}listen:
2828fi
2929elif [ " ${tun_mode} " -eq 1 ] && [ " ${core} " -eq 3 ] || [ " ${tun_mode} " -eq 1 ] && [ " ${core} " -eq 4 ]; then
3030 uci set clash.config.mode=" 0" && uci set clash.config.tun_mode=" 1" && uci commit clash
31-
32- else
33- uci set clash.config.mode=" 0" && uci set clash.config.tun_mode=" 0" && uci commit clash
3431fi
3532fi
3633
3734
38- if [ " ${ core} " -eq 1 ] || [ " ${ core} " -eq 2 ]; then
35+ if [ " $core " -eq 1 ] || [ " $core " -eq 2 ]; then
3936if [ " ${mode} " -eq 0 ] && [ " ${core} " -eq 1 ] || [ " ${mode} " -eq 0 ] && [ " ${core} " -eq 2 ]; then
4037if [ -z " $( grep " ^ \{0,\}listen:" $CONFIG_YAML ) " ] || [ -z " $( grep " ^ \{0,\}enhanced-mode:" $CONFIG_YAML ) " ] || [ -z " $( grep " ^ \{0,\}enable:" $CONFIG_YAML ) " ] || [ -z " $( grep " ^ \{0,\}dns:" $CONFIG_YAML ) " ] ; then
4138 uci set clash.config.mode=" 1" && uci set clash.config.tun_mode=" 0" && uci commit clash
4239fi
43- elif [ " ${ mode} " -eq 1 ] && [ " ${ core} " -eq 1 ] || [ " ${ mode} " -eq 1 ] && [ " ${ core} " -eq 2 ]; then
40+ elif [ " $mode " -eq 1 ] && [ " $core " -eq 1 ] || [ " $mode " -eq 1 ] && [ " $core " -eq 2 ]; then
4441 uci set clash.config.mode=" 1" && uci set clash.config.tun_mode=" 0" && uci commit clash
4542
46- else
47- uci set clash.config.mode=" 0" && uci set clash.config.tun_mode=" 0" && uci commit clash
4843fi
4944fi
5045
@@ -68,9 +63,9 @@ sleep 3
6863 p_mode=$( uci get clash.config.p_mode 2> /dev/null)
6964
7065if [ " ${mode} " -eq 1 ]; then
71-
66+ if [ " $core " -eq 1 ] || [ " $core " -eq 2 ] ; then
7267 if [ $lang == " en" ] || [ $lang == " auto" ]; then
73- echo " Setting Up Ports and Password.. " > $REAL_LOG
68+ echo " Setting Up Ports and Password.. " > $REAL_LOG
7469 elif [ $lang == " zh_cn" ]; then
7570 echo " 设置端口,DNS和密码..." > $REAL_LOG
7671 fi
@@ -123,9 +118,9 @@ if [ "${mode}" -eq 1 ]; then
123118 sed -i " /dns:/i\ " $CONFIG_YAML 2> /dev/null
124119 fi
125120 sed -i ' /#clash-openwrt/ d' $CONFIG_YAML 2> /dev/null
126-
121+ fi
127122elif [ " ${tun_mode} " -eq 1 ]; then
128-
123+ if [ " ${core} " -eq 3 ] || [ " ${core} " -eq 4 ] ; then
129124 if [ $lang == " en" ] || [ $lang == " auto" ]; then
130125 echo " Setting Up Ports and Password.. " > $REAL_LOG
131126 elif [ $lang == " zh_cn" ]; then
@@ -178,6 +173,7 @@ elif [ "${tun_mode}" -eq 1 ]; then
178173 sed -i " /dns:/i\ " $CONFIG_YAML 2> /dev/null
179174 fi
180175 sed -i ' /#clash-openwrt/ d' $CONFIG_YAML 2> /dev/null
176+ fi
181177else
182178 if [ $lang == " en" ] || [ $lang == " auto" ]; then
183179 echo " Setting Up Ports and Password.. " > $REAL_LOG
0 commit comments