-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathservice.sh
More file actions
21 lines (17 loc) · 837 Bytes
/
service.sh
File metadata and controls
21 lines (17 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
MODDIR=${0%/*}
CONFIG_FILE=/data/media/0/dnscrypt-proxy/dnscrypt-proxy.toml
LOG_FILE=/data/media/0/dnscrypt-proxy/dnscrypt-proxy.log
L_CONFIG_FILE=/data/media/0/dnscrypt-proxy/dnscrypt-proxy.conf
if [ -s $L_CONFIG_FILE ]; then
. $L_CONFIG_FILE
fi
# clear log
rm -f $LOG_FILE
# dnscrypt-proxy service.sh
$MODDIR/system/bin/dnscrypt-proxy -config $CONFIG_FILE -logfile $LOG_FILE > /dev/null 2>&1 &
if [ "$AUTO_REDIRECTION" = "true" ]; then
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
fi