initial commit of file from CVS for smeserver-coova-chilli on Sat Sep 7 20:15:38 AEST 2024
This commit is contained in:
5
root/etc/chilli/call_condown.sh
Normal file
5
root/etc/chilli/call_condown.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
exec /usr/bin/sudo /etc/chilli/condown.sh $ADDR $FRAMED_IP_ADDRESS
|
||||
|
||||
|
4
root/etc/chilli/call_conup.sh
Normal file
4
root/etc/chilli/call_conup.sh
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
exec /usr/bin/sudo /etc/chilli/conup.sh $ADDR $FRAMED_IP_ADDRESS
|
||||
|
13
root/etc/chilli/condown.sh
Normal file
13
root/etc/chilli/condown.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/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
|
||||
|
16
root/etc/chilli/conup.sh
Normal file
16
root/etc/chilli/conup.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/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)
|
||||
# We need to insert rules just before the accept, so we'll have to compute this position
|
||||
POSITION=$(LANG=C iptables -t nat -L PREROUTING_FROM_CHILLI -n | \
|
||||
egrep -v '(Chain|target)' | grep -n ACCEPT | cut -d':' -f1)
|
||||
/sbin/iptables -t nat -I PREROUTING_FROM_CHILLI $POSITION -s $2 \
|
||||
-p tcp --dport 80 -j DNAT --to $1:$SQUID_PORT
|
||||
/sbin/iptables -I IN_FROM_CHILLI 7 -s $2 \
|
||||
-p tcp --dport $SQUID_PORT --syn -j ACCEPT
|
||||
fi
|
||||
|
Reference in New Issue
Block a user