Fix restart script

This commit is contained in:
CodeRoK7
2025-02-21 11:41:07 +05:00
committed by GitHub
parent 6fde98ea26
commit 4de28f6b47

View File

@@ -13,17 +13,15 @@ opkg update
opkg upgrade youtubeUnblock opkg upgrade youtubeUnblock
opkg upgrade luci-app-youtubeUnblock opkg upgrade luci-app-youtubeUnblock
echo "Backup files..."
if [ ! -d "$DIR_BACKUP" ] if [ ! -d "$DIR_BACKUP" ]
then then
echo "Backup files..."
mkdir $DIR_BACKUP mkdir $DIR_BACKUP
fi
for file in $config_files for file in $config_files
do do
cp -f "$DIR/$file" "$DIR_BACKUP/$file" cp -f "$DIR/$file" "$DIR_BACKUP/$file"
done done
fi
echo "Replace configs..." echo "Replace configs..."
@@ -61,6 +59,14 @@ uci add_list dhcp.cfg01411c.server='/*.clash.com/127.0.0.1#5056'
uci add_list dhcp.cfg01411c.server='/*.clashofclans.com/127.0.0.1#5056' uci add_list dhcp.cfg01411c.server='/*.clashofclans.com/127.0.0.1#5056'
uci add_list dhcp.cfg01411c.server='/*.x.ai/127.0.0.1#5056' uci add_list dhcp.cfg01411c.server='/*.x.ai/127.0.0.1#5056'
uci add_list dhcp.cfg01411c.server='/*.grok.com/127.0.0.1#5056' uci add_list dhcp.cfg01411c.server='/*.grok.com/127.0.0.1#5056'
uci commit dhcp
nameRule="option name 'chatgpt.com'"
str=$(grep -i "$nameRule" /etc/config/dhcp)
if [ -z "$str" ]
then
echo "Add unblock ChatGPT..."
uci add dhcp domain # =cfg13f37d uci add dhcp domain # =cfg13f37d
uci set dhcp.@domain[-1].name='chatgpt.com' uci set dhcp.@domain[-1].name='chatgpt.com'
uci set dhcp.@domain[-1].ip='94.131.119.85' uci set dhcp.@domain[-1].ip='94.131.119.85'
@@ -68,7 +74,12 @@ uci add dhcp domain # =cfg14f37d
uci set dhcp.@domain[-1].name='openai.com' uci set dhcp.@domain[-1].name='openai.com'
uci set dhcp.@domain[-1].ip='94.131.119.85' uci set dhcp.@domain[-1].ip='94.131.119.85'
uci commit dhcp uci commit dhcp
fi
nameRule="option name 'Block_UDP_443'"
str=$(grep -i "$nameRule" /etc/config/firewall)
if [ -z "$str" ]
then
echo "Add block QUIC..." echo "Add block QUIC..."
uci add firewall rule # =cfg2492bd uci add firewall rule # =cfg2492bd
@@ -86,6 +97,8 @@ uci set firewall.@rule[-1].dest='wan'
uci set firewall.@rule[-1].dest_port='443' uci set firewall.@rule[-1].dest_port='443'
uci set firewall.@rule[-1].target='REJECT' uci set firewall.@rule[-1].target='REJECT'
uci commit firewall uci commit firewall
service firewall restart
fi
echo "Crod task add restart service yotubeUnblock..." echo "Crod task add restart service yotubeUnblock..."