2018-02-27 14:42:14 +00:00
|
|
|
#!/system/bin/sh
|
2019-05-01 08:07:18 +00:00
|
|
|
# Do NOT assume where your module will be located.
|
|
|
|
# ALWAYS use $MODDIR if you need to know where this script
|
|
|
|
# and module is placed.
|
|
|
|
# This will make sure your module will still work
|
|
|
|
# if Magisk change its mount point in the future
|
2018-02-27 14:42:14 +00:00
|
|
|
MODDIR=${0%/*}
|
|
|
|
|
2018-03-21 17:13:57 +00:00
|
|
|
for i in 1 2 3 4 5 6 7 8 9 10 11 12; do
|
2018-03-06 17:31:52 +00:00
|
|
|
ping -c 1 download.dnscrypt.info
|
2018-02-27 14:42:14 +00:00
|
|
|
if [[ $? == 0 ]];
|
|
|
|
then
|
2019-05-01 08:07:18 +00:00
|
|
|
$MODDIR/system/bin/dnscrypt-proxy -config $MODDIR/system/etc/dnscrypt-proxy/dnscrypt-proxy.toml &
|
2018-03-31 06:20:59 +00:00
|
|
|
sleep 15
|
2019-04-23 10:03:49 +00:00
|
|
|
iptables -t nat -A OUTPUT -p tcp ! -d 9.9.9.9 --dport 53 -j DNAT --to-destination 127.0.0.1:5354
|
|
|
|
iptables -t nat -A OUTPUT -p udp ! -d 9.9.9.9 --dport 53 -j DNAT --to-destination 127.0.0.1:5354
|
|
|
|
ip6tables -t nat -A OUTPUT -p tcp ! -d 9.9.9.9 --dport 53 -j DNAT --to-destination [::1]:5354
|
|
|
|
ip6tables -t nat -A OUTPUT -p udp ! -d 9.9.9.9 --dport 53 -j DNAT --to-destination [::1]:5354
|
2018-02-27 14:42:14 +00:00
|
|
|
break;
|
|
|
|
else
|
|
|
|
sleep 5
|
|
|
|
fi
|
2018-02-27 15:14:23 +00:00
|
|
|
done
|