Update service.sh

This commit is contained in:
George Daniel 2019-06-12 06:20:08 +00:00 committed by GitHub
parent c7306db6c3
commit e531c7a6b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 15 deletions

View File

@ -6,18 +6,13 @@
# if Magisk change its mount point in the future # if Magisk change its mount point in the future
MODDIR=${0%/*} MODDIR=${0%/*}
for i in 1 2 3 4 5 6 7 8 9 10 11 12; do
ping -c 1 download.dnscrypt.info # change config directory from /system/etc to /data/media/0/dnscrypt-proxy
if [[ $? == 0 ]]; # /sdcard is softlink to /data/media/0 in lineageos 16
then $MODDIR/system/bin/dnscrypt-proxy -config /data/media/0/dnscrypt-proxy/dnscrypt-proxy.toml
$MODDIR/system/bin/dnscrypt-proxy -config $MODDIR/system/etc/dnscrypt-proxy/dnscrypt-proxy.toml &
sleep 15 #IPTABLES
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 tcp ! -d 1.1.1.1 --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 iptables -t nat -A OUTPUT -p udp ! -d 1.1.1.1 --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 tcp ! -d 1.1.1.1 --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 ip6tables -t nat -A OUTPUT -p udp ! -d 1.1.1.1 --dport 53 -j DNAT --to-destination [::1]:5354
break;
else
sleep 5
fi
done