luci-app-turboacc: Optimized the dns cache stop action (#8744)

The actual script dnscache-while.sh is still in the process after the DNS cache stops. This optimization completely stops the script and the DNS cache process
This commit is contained in:
zxlhhyccc 2022-01-23 21:42:41 +08:00 committed by GitHub
parent 0ce82c9f14
commit b535638922
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,6 +10,8 @@ EXTRA_HELP=" check_status Check running status of utils"
restart_utils="true" restart_utils="true"
PS="/bin/busybox ps"
inital_conf(){ inital_conf(){
config_load "turboacc" config_load "turboacc"
config_get "sw_flow" "config" "sw_flow" "0" config_get "sw_flow" "config" "sw_flow" "0"
@ -201,8 +203,9 @@ start_dnsproxy() {
} }
stop_dnscache() { stop_dnscache() {
killall -9 "dnscache" $PS -w | grep dnscache | grep -v "grep" | awk '{print $1}' | xargs kill -9 >/dev/null 2>&1 &
kill -9 $(ps | grep dnscache-while.sh | grep -v "grep" | awk '{print $1}') $PS -w | grep dnscache-while.sh | grep -v "grep" | awk '{print $1}' | xargs kill -9 >/dev/null 2>&1 &
killall -q -9 dnscache
rm -rf "/var/dnscache" "/var/run/dnscache" rm -rf "/var/dnscache" "/var/run/dnscache"
echo "Stop DNS Caching" echo "Stop DNS Caching"
} }