Enable hev-socks5-tunnel if disabled

Added checks to enable the hev-socks5-tunnel if it is currently disabled.
This commit is contained in:
StressOzz authored and GitHub committed 2026-09-02 20:34:30 +05:00
1 parent d1d99be48b
commit b891700a37
1 file changed
+15
+15
View File
@@ -1291,6 +1291,12 @@ fi
uci set hev-socks5-tunnel.@instance[0].enabled='1' uci set hev-socks5-tunnel.@instance[0].enabled='1'
uci set hev-socks5-tunnel.@instance[0].conffile='/etc/hev-socks5-tunnel/main.yml' uci set hev-socks5-tunnel.@instance[0].conffile='/etc/hev-socks5-tunnel/main.yml'
uci commit hev-socks5-tunnel uci commit hev-socks5-tunnel
if grep -qE "^[[:space:]]*option[[:space:]]+enabled[[:space:]]+'0'" /etc/config/hev-socks5-tunnel
then
sed -i -E "s/^([[:space:]]*option[[:space:]]+enabled[[:space:]]+)'0'/\1'1'/" /etc/config/hev-socks5-tunnel
fi
/etc/init.d/hev-socks5-tunnel restart /etc/init.d/hev-socks5-tunnel restart
sleep 2 sleep 2
@@ -1487,6 +1493,15 @@ cp -r /tmp/zashboard/* "$DIR1"/ 2>/dev/null || {
rm -rf "$TMP1" "$TMP2" rm -rf "$TMP1" "$TMP2"
if grep -qE "^[[:space:]]*option[[:space:]]+enabled[[:space:]]+'0'" /etc/config/hev-socks5-tunnel; then
sed -i -E "s/^([[:space:]]*option[[:space:]]+enabled[[:space:]]+)'0'/\11'/g" /etc/config/hev-socks5-tunnel
fi
if grep -qE "^[[:space:]]*option[[:space:]]+enabled[[:space:]]+'0'" /etc/config/hev-socks5-tunnel
then
sed -i -E "s/^([[:space:]]*option[[:space:]]+enabled[[:space:]]+)'0'/\1'1'/" /etc/config/hev-socks5-tunnel
fi
/etc/init.d/mihomo restart >/dev/null 2>&1 /etc/init.d/mihomo restart >/dev/null 2>&1
/etc/init.d/hev-socks5-tunnel restart >/dev/null 2>&1 /etc/init.d/hev-socks5-tunnel restart >/dev/null 2>&1