14 lines
488 B
Bash
14 lines
488 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
SQUID_STATUS=$(/sbin/e-smith/db configuration getprop squid status)
|
||
|
WEB_REQ=$(/sbin/e-smith/db configuration getprop chilli WebRequests)
|
||
|
|
||
|
if [[ $SQUID_STATUS == 'enabled' && $WEB_REQ == 'squid' ]]; then
|
||
|
SQUID_PORT=$(/sbin/e-smith/db configuration getprop squid TransparentPort)
|
||
|
/sbin/iptables -D IN_FROM_CHILLI -s $2 \
|
||
|
-p tcp --dport $SQUID_PORT --syn -j ACCEPT
|
||
|
/sbin/iptables -t nat -D PREROUTING_FROM_CHILLI -s $2 \
|
||
|
-p tcp --dport 80 -j DNAT --to $1:$SQUID_PORT
|
||
|
fi
|
||
|
|