forked from carbonsphere/dock-privoxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·28 lines (23 loc) · 880 Bytes
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
PRIVOXYDIR=/etc/privoxy
EASYLISTA=easylist.script.filter
EASYLISTB=easylist.script.action
#FORWARD_DNS=tor
#FORWARD_PORT=5566
PRIVOXY_CONF=/etc/privoxy/config
FORWARD_RULE="forward / "
RET=$(grep "^${FORWARD_RULE}" ${PRIVOXY_CONF})
if [[ ("$FORWARD_DNS" != "") && ("FORWARD_PORT" != "") ]]; then
echo "Forwarding DNS exist. Adding forwarding directive to ${PRIVOXY_CONF}"
#comment out existing directive
sed -i "/$(echo "${FORWARD_RULE}" | sed "s#\/#\\\/#g")/d" ${PRIVOXY_CONF}
echo "Adding forwarding rule"
echo "${FORWARD_RULE}${FORWARD_DNS}:${FORWARD_PORT}" >> ${PRIVOXY_CONF}
fi
if [[ (-e "$PRIVOXYDIR/$EASYLISTA") && (-e "$PRIVOXYDIR/$EASYLISTB") ]]; then
echo "Easy Lists Found. Skipping download..."
else
echo "Files not found! Running download..."
/usr/local/bin/privoxy-blist.sh
fi
/usr/sbin/privoxy --no-daemon /etc/privoxy/config