From 577df6b406755079f8eb5ec726b9664f86bcc213 Mon Sep 17 00:00:00 2001 From: CodeRoK7 <58553260+CodeRoK7@users.noreply.github.com> Date: Thu, 27 Feb 2025 16:25:02 +0000 Subject: [PATCH 1/5] Change repo --- awg_config.sh | 2 +- configure_zaprets.sh | 2 +- off_configure_zaprets.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/awg_config.sh b/awg_config.sh index 5e73e37..5900688 100644 --- a/awg_config.sh +++ b/awg_config.sh @@ -301,7 +301,7 @@ done path_podkop_config="/etc/config/podkop" path_podkop_config_backup="/root/podkop" -URL="https://raw.githubusercontent.com/routerich/RouterichAX3000_configs/refs/heads/main" +URL="https://raw.githubusercontent.com/CodeRoK7/RouterichAX3000_configs/refs/heads/main" if [ -f "/etc/init.d/podkop" ]; then printf "Podkop installed. Reconfigured on AWG WARP? (y/n): \n" diff --git a/configure_zaprets.sh b/configure_zaprets.sh index d382d7f..46454d0 100644 --- a/configure_zaprets.sh +++ b/configure_zaprets.sh @@ -1,6 +1,6 @@ #!/bin/sh -URL="https://raw.githubusercontent.com/routerich/RouterichAX3000_configs/refs/heads/main" +URL="https://raw.githubusercontent.com/CodeRoK7/RouterichAX3000_configs/refs/heads/main" DIR="/etc/config" DIR_BACKUP="/root/backup" config_files="dhcp diff --git a/off_configure_zaprets.sh b/off_configure_zaprets.sh index a827626..baf7919 100644 --- a/off_configure_zaprets.sh +++ b/off_configure_zaprets.sh @@ -1,6 +1,6 @@ #!/bin/sh -URL="https://raw.githubusercontent.com/routerich/RouterichAX3000_configs/refs/heads/main" +URL="https://raw.githubusercontent.com/CodeRoK7/RouterichAX3000_configs/refs/heads/main" DIR="/etc/config" DIR_BACKUP="/root/backup" config_files="dhcp From 668919c05d9defb677b04290344eeeb90fc11c8f Mon Sep 17 00:00:00 2001 From: CodeRoK7 <58553260+CodeRoK7@users.noreply.github.com> Date: Thu, 27 Feb 2025 21:36:02 +0500 Subject: [PATCH 2/5] Delete cron task auto run script --- awg_config.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/awg_config.sh b/awg_config.sh index 5900688..79f6ccd 100644 --- a/awg_config.sh +++ b/awg_config.sh @@ -342,6 +342,10 @@ printf "\033[32;1mStop and disabled service 'youtubeUnblock' and 'ruantiblock'. manage_package "youtubeUnblock" "disable" "stop" manage_package "ruantiblock" "disable" "stop" +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" + printf "\033[32;1mRestart firewall and network...\033[0m\n" service firewall restart service network restart From 8184dc1d851029f8f419c259954a8ce616b4bcba Mon Sep 17 00:00:00 2001 From: CodeRoK7 <58553260+CodeRoK7@users.noreply.github.com> Date: Thu, 27 Feb 2025 22:03:43 +0500 Subject: [PATCH 3/5] Check autorun script configure_zaprets.sh --- awg_config.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/awg_config.sh b/awg_config.sh index 79f6ccd..d3c73d7 100644 --- a/awg_config.sh +++ b/awg_config.sh @@ -342,9 +342,13 @@ printf "\033[32;1mStop and disabled service 'youtubeUnblock' and 'ruantiblock'. manage_package "youtubeUnblock" "disable" "stop" manage_package "ruantiblock" "disable" "stop" -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" +str=$(grep -i "0 4 \* \* \* wget -O - $URL/configure_zaprets.sh | sh" /etc/crontabs/root) +if [ ! -z "$str" ] +then + 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" +fi printf "\033[32;1mRestart firewall and network...\033[0m\n" service firewall restart From 380c8e44fe7f5a750b12fca22485157a5195cae3 Mon Sep 17 00:00:00 2001 From: CodeRoK7 <58553260+CodeRoK7@users.noreply.github.com> Date: Thu, 27 Feb 2025 22:05:03 +0500 Subject: [PATCH 4/5] Check autorun script configure_zaprets.sh --- off_configure_zaprets.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/off_configure_zaprets.sh b/off_configure_zaprets.sh index baf7919..db0bc44 100644 --- a/off_configure_zaprets.sh +++ b/off_configure_zaprets.sh @@ -27,8 +27,12 @@ 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" +str=$(grep -i "0 4 \* \* \* wget -O - $URL/configure_zaprets.sh | sh" /etc/crontabs/root) +if [ ! -z "$str" ] +then + 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" +fi printf "\033[32;1mOff configured completed...\033[0m" From a173eb4931732067628021f6306434a596b76401 Mon Sep 17 00:00:00 2001 From: CodeRoK7 <58553260+CodeRoK7@users.noreply.github.com> Date: Thu, 27 Feb 2025 22:09:16 +0500 Subject: [PATCH 5/5] Check and stop service Podkop --- configure_zaprets.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/configure_zaprets.sh b/configure_zaprets.sh index 46454d0..e3a33a2 100644 --- a/configure_zaprets.sh +++ b/configure_zaprets.sh @@ -21,6 +21,38 @@ checkAndAddDomainPermanentName() fi } +manage_package() { + local name="$1" + local autostart="$2" + local process="$3" + + # Проверка, установлен ли пакет + if opkg list-installed | grep -q "^$name"; then + + # Проверка, включен ли автозапуск + if /etc/init.d/$name enabled; then + if [ "$autostart" = "disable" ]; then + /etc/init.d/$name disable + fi + else + if [ "$autostart" = "enable" ]; then + /etc/init.d/$name enable + fi + fi + + # Проверка, запущен ли процесс + if pidof $name > /dev/null; then + if [ "$process" = "stop" ]; then + /etc/init.d/$name stop + fi + else + if [ "$process" = "start" ]; then + /etc/init.d/$name start + fi + fi + fi +} + echo "Upgrade packages..." opkg update @@ -147,6 +179,8 @@ then echo "$cronTask" >> /etc/crontabs/root fi +manage_package "podkop" "disable" "stop" + echo "Restart service..." service youtubeUnblock restart