Fix sleep command, don't use dangerous loop

Running sleep command synchronously fixes issues with v4a (not sure why).
For loop runs for a minute and then quits - in event user is in area with no signal and wifi, prevents endless loop
This commit is contained in:
Zackptg5 2018-03-21 13:13:57 -04:00 committed by GitHub
parent 8556bf8676
commit d73b8b63ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 5 deletions

View File

@ -6,14 +6,11 @@ MODDIR=${0%/*}
# This script will be executed in late_start service mode
# More info in the main Magisk thread
while true
do
for i in 1 2 3 4 5 6 7 8 9 10 11 12; do
ping -c 1 download.dnscrypt.info
if [[ $? == 0 ]];
then
$MODDIR/system/xbin/dnscrypt-proxy -config $MODDIR/system/etc/dnscrypt-proxy/dnscrypt-proxy.toml &
sleep 5
$MODDIR/system/xbin/dnscrypt-proxy -config $MODDIR/system/etc/dnscrypt-proxy/dnscrypt-proxy.toml && sleep 5
iptables -t nat -A OUTPUT -p tcp --dport 53 -j DNAT --to-destination 127.0.0.1:5354
iptables -t nat -A OUTPUT -p udp --dport 53 -j DNAT --to-destination 127.0.0.1:5354
break;