Skip to content

Commit

Permalink
Use the PID file to kill the service on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
D4ZTKit authored and jedisct1 committed Jan 22, 2017
1 parent b2d4969 commit d6b61d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dist-build/android-files/system/xbin/dnscrypt
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ 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
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
Expand Down

0 comments on commit d6b61d9

Please sign in to comment.