Skip to content

Commit 265a9c5

Browse files
author
frainzy1477
committed
1.6.1f
1 parent 59bb03d commit 265a9c5

1 file changed

Lines changed: 7 additions & 11 deletions

File tree

root/usr/share/clash/yum_change.sh

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,18 @@ if [ -z "$(grep "^ \{0,\}tun:" $CONFIG_YAML)" ] || [ -z "$(grep "^ \{0,\}listen:
2828
fi
2929
elif [ "${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
3431
fi
3532
fi
3633

3734

38-
if [ "${core}" -eq 1 ] || [ "${core}" -eq 2 ];then
35+
if [ "$core" -eq 1 ] || [ "$core" -eq 2 ];then
3936
if [ "${mode}" -eq 0 ] && [ "${core}" -eq 1 ] || [ "${mode}" -eq 0 ] && [ "${core}" -eq 2 ];then
4037
if [ -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
4239
fi
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
4843
fi
4944
fi
5045

@@ -68,9 +63,9 @@ sleep 3
6863
p_mode=$(uci get clash.config.p_mode 2>/dev/null)
6964

7065
if [ "${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
127122
elif [ "${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
181177
else
182178
if [ $lang == "en" ] || [ $lang == "auto" ];then
183179
echo "Setting Up Ports and Password.. " >$REAL_LOG

0 commit comments

Comments
 (0)