From d6b61d98959450985f8079e09b2d8f13092eef94 Mon Sep 17 00:00:00 2001 From: D4ZTKit Date: Sun, 22 Jan 2017 16:54:03 +0100 Subject: [PATCH] Use the PID file to kill the service on Android --- dist-build/android-files/system/xbin/dnscrypt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dist-build/android-files/system/xbin/dnscrypt b/dist-build/android-files/system/xbin/dnscrypt index aae7945c..4757f8b6 100755 --- a/dist-build/android-files/system/xbin/dnscrypt +++ b/dist-build/android-files/system/xbin/dnscrypt @@ -4,7 +4,7 @@ if [ "x${1}" = "xenable" -o "x${1}" = "xENABLE" ]; then echo "Enabling dnscrypt-proxy..." iptables -t nat -A OUTPUT -p udp --dport 53 -j DNAT --to-destination 127.0.0.1 iptables -t nat -A OUTPUT -p tcp --dport 53 -j DNAT --to-destination 127.0.0.1 - ps ax | grep 'dnscrypt-proxy' | while read pid _; do kill "$pid" ; done + kill $(cat /data/local/tmp/dnscrypt-proxy.pid) /system/etc/init.d/99dnscrypt echo "Done" exit @@ -12,7 +12,7 @@ elif [ "x${1}" = "xdisable" -o "x${1}" = "xDISABLE" ]; then echo "Disabling dnscrypt-proxy..." iptables -t nat -D OUTPUT -p udp --dport 53 -j DNAT --to-destination 127.0.0.1 iptables -t nat -D OUTPUT -p tcp --dport 53 -j DNAT --to-destination 127.0.0.1 - ps ax | grep 'dnscrypt-proxy' | while read pid _; do kill "$pid" ; done + kill $(cat /data/local/tmp/dnscrypt-proxy.pid) echo "Done" exit else