Merge pull request #3 from CodeRoK7/main

More changes. View Description
This commit is contained in:
CodeRoK7
2025-02-22 00:38:23 +05:00
committed by GitHub
3 changed files with 65 additions and 17 deletions

View File

@@ -7,24 +7,36 @@ config_files="dhcp
youtubeUnblock youtubeUnblock
https-dns-proxy" https-dns-proxy"
checkAndAddDomainPermanentName()
{
nameRule="option name '$1'"
str=$(grep -i "$nameRule" /etc/config/dhcp)
if [ -z "$str" ]
then
uci add dhcp domain
uci set dhcp.@domain[-1].name="$1"
uci set dhcp.@domain[-1].ip="$2"
uci commit dhcp
fi
}
echo "Upgrade packages..." echo "Upgrade packages..."
opkg update 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
for file in $config_files
do
cp -f "$DIR/$file" "$DIR_BACKUP/$file"
done
fi fi
for file in $config_files
do
cp -f "$DIR/$file" "$DIR_BACKUP/$file"
done
echo "Replace configs..." echo "Replace configs..."
for file in $config_files for file in $config_files
@@ -59,20 +71,47 @@ uci add_list dhcp.cfg01411c.server='/*.clashroyale.com/127.0.0.1#5056'
uci add_list dhcp.cfg01411c.server='/*.brawlstars.com/127.0.0.1#5056' uci add_list dhcp.cfg01411c.server='/*.brawlstars.com/127.0.0.1#5056'
uci add_list dhcp.cfg01411c.server='/*.clash.com/127.0.0.1#5056' 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 dhcp domain # =cfg13f37d uci add_list dhcp.cfg01411c.server='/*.x.ai/127.0.0.1#5056'
uci set dhcp.@domain[-1].name='chatgpt.com' uci add_list dhcp.cfg01411c.server='/*.grok.com/127.0.0.1#5056'
uci set dhcp.@domain[-1].ip='94.131.119.85'
uci add dhcp domain # =cfg14f37d
uci set dhcp.@domain[-1].name='openai.com'
uci set dhcp.@domain[-1].ip='94.131.119.85'
uci commit dhcp uci commit dhcp
echo "Crod task add restart service yotubeUnblock..." echo "Add unblock ChatGPT..."
cronTask="0 4 * * * service youtubeUnblock restart" checkAndAddDomainPermanentName "chatgpt.com" "94.131.119.85"
str=$(grep -i "0 4 \* \* \* service youtubeUnblock restart" /etc/crontabs/root) checkAndAddDomainPermanentName "openai.com" "94.131.119.85"
checkAndAddDomainPermanentName "webrtc.chatgpt.com" "94.131.119.85"
checkAndAddDomainPermanentName "ios.chat.openai.com" "94.131.119.85"
checkAndAddDomainPermanentName "searchgpt.com" "94.131.119.85"
nameRule="option name 'Block_UDP_443'"
str=$(grep -i "$nameRule" /etc/config/firewall)
if [ -z "$str" ] if [ -z "$str" ]
then then
echo "Add block QUIC..."
uci add firewall rule # =cfg2492bd
uci set firewall.@rule[-1].name='Block_UDP_80'
uci add_list firewall.@rule[-1].proto='udp'
uci set firewall.@rule[-1].src='lan'
uci set firewall.@rule[-1].dest='wan'
uci set firewall.@rule[-1].dest_port='80'
uci set firewall.@rule[-1].target='REJECT'
uci add firewall rule # =cfg2592bd
uci set firewall.@rule[-1].name='Block_UDP_443'
uci add_list firewall.@rule[-1].proto='udp'
uci set firewall.@rule[-1].src='lan'
uci set firewall.@rule[-1].dest='wan'
uci set firewall.@rule[-1].dest_port='443'
uci set firewall.@rule[-1].target='REJECT'
uci commit firewall
service firewall restart
fi
cronTask="0 4 * * * wget -O - $URL/configure_zaprets.sh | sh"
str=$(grep -i "0 4 \* \* \* wget -O - $URL/configure_zaprets.sh | sh" /etc/crontabs/root)
if [ -z "$str" ]
then
echo "Add cron task auto run configure_zapret..."
echo "$cronTask" >> /etc/crontabs/root echo "$cronTask" >> /etc/crontabs/root
fi fi

View File

@@ -28,7 +28,7 @@ config https-dns-proxy
config https-dns-proxy config https-dns-proxy
option resolver_url 'https://router.comss.one/dns-query' option resolver_url 'https://router.comss.one/dns-query'
option bootstrap_dns '195.133.25.16, 212.109.195.93' option bootstrap_dns '195.133.25.16,212.109.195.93'
option listen_addr '127.0.0.1' option listen_addr '127.0.0.1'
option listen_port '5056' option listen_port '5056'

View File

@@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
URL="https://raw.githubusercontent.com/CodeRoK7/RouterichAX3000_configs/refs/heads/main"
DIR="/etc/config" DIR="/etc/config"
DIR_BACKUP="/root/backup" DIR_BACKUP="/root/backup"
config_files="dhcp config_files="dhcp
@@ -13,6 +14,8 @@ do
cp -f "$DIR_BACKUP/$file" "$DIR/$file" cp -f "$DIR_BACKUP/$file" "$DIR/$file"
done done
rm -rf "$DIR_BACKUP"
echo "Restart service..." echo "Restart service..."
service youtubeUnblock restart service youtubeUnblock restart
@@ -20,4 +23,10 @@ service https-dns-proxy restart
service dnsmasq restart service dnsmasq restart
service odhcpd restart service odhcpd restart
echo "Remove cron task auto run script configure zaprets.."
grep -v "0 4 \* \* \* wget -O - $URL/configure_zaprets.sh | sh" /etc/crontabs/root > /etc/crontabs/temp
cp -f "/etc/crontabs/temp" "/etc/crontabs/root"
rm -f "/etc/crontabs/temp"
echo "Off configure complete..." echo "Off configure complete..."