dnscrypt-proxy-android/common/service.sh

22 lines
718 B
Bash
Raw Normal View History

2018-02-27 14:42:14 +00:00
#!/system/bin/sh
# Please don't hardcode /magisk/modname/... ; instead, please use $MODDIR/...
# This will make your scripts compatible even if Magisk change its mount point in the future
MODDIR=${0%/*}
# This script will be executed in late_start service mode
# More info in the main Magisk thread
for i in 1 2 3 4 5 6 7 8 9 10 11 12; do
ping -c 1 download.dnscrypt.info
2018-02-27 14:42:14 +00:00
if [[ $? == 0 ]];
then
2018-03-21 17:38:47 +00:00
$MODDIR/system/xbin/dnscrypt-proxy -config $MODDIR/system/etc/dnscrypt-proxy/dnscrypt-proxy.toml &
sleep 15
2018-03-18 04:13:38 +00:00
iptables -t nat -A OUTPUT -p tcp --dport 53 -j DNAT --to-destination 127.0.0.1:5354
2018-03-20 08:27:55 +00:00
iptables -t nat -A OUTPUT -p udp --dport 53 -j DNAT --to-destination 127.0.0.1:5354
2018-02-27 14:42:14 +00:00
break;
else
sleep 5
fi
2018-02-27 15:14:23 +00:00
done