]>
git.ipfire.org Git - people/dweismueller/ipfire-2.x.git/blob - src/initscripts/init.d/squid
2 # Begin $rc_base/init.d/squid
10 eval $
(/usr
/local
/bin
/readhash
/var
/ipfire
/ethernet
/settings
)
11 eval $
(/usr
/local
/bin
/readhash
/var
/ipfire
/proxy
/settings
)
13 # If the proxy port is not set we set the default to 800.
14 if [ -z $PROXY_PORT ]; then
18 LOCALIP
=`cat /var/ipfire/red/local-ipaddress | tr -d \n`
19 if [ -z $LOCALIP ]; then
20 boot_mesg
"Couldn't read local-ipaddress" ${FAILURE}
25 FILE
=/var
/ipfire
/vpn
/config
29 CONN_TYPE
=`echo "$LINE" | awk -F, '{ print $5 }'`
30 if [ "$CONN_TYPE" != "net" ]; then
33 iptables
-t nat
-A SQUID
-i $1 -p tcp
-d `echo "$LINE" | awk -F, '{ print $13 }'` --dport 80 -j RETURN
36 if [ "$RED_TYPE" == "STATIC" ]; then
37 iptables
-t nat
-A SQUID
-i $1 -p tcp
-d $RED_NETADDRESS/$RED_NETMASK --dport 80 -j RETURN
40 iptables
-t nat
-A SQUID
-i $1 -p tcp
-d $LOCALIP --dport 80 -j RETURN
42 iptables
-t nat
-A SQUID
-i $1 -p tcp
--dport 80 -j REDIRECT
--to-port $PROXY_PORT
47 boot_mesg
"Starting Squid Proxy Server..."
49 if [ -e /var
/ipfire
/proxy
/enable -o -e /var
/ipfire
/proxy
/enable_blue
]; then
50 loadproc
/usr
/sbin
/squid
-D -z >/dev
/null
2>&1
51 loadproc
/usr
/sbin
/squid
-D
54 eval $
(/usr
/local
/bin
/readhash
/var
/ipfire
/ethernet
/settings
)
56 if [ -e /var
/ipfire
/proxy
/transparent
]; then
57 transparent
$GREEN_DEV
59 if [ -e /var
/ipfire
/proxy
/transparent_blue
]; then
65 boot_mesg
"Stopping Squid Proxy Server..."
66 iptables
-t nat
-F SQUID
67 squid
-k shutdown
>/dev
/null
2>&1
69 killproc
/usr
/sbin
/squid
>/dev
/null
70 killproc
/usr
/bin
/squidGuard
>/dev
/null
80 statusproc
/usr
/sbin
/squid
81 statusproc
/usr
/lib
/squid
/unlinkd
86 echo > /var
/log
/cache
/swap.state
87 chown squid.squid
/var
/log
/cache
/swap.state
93 echo "Usage: $0 {start|stop|restart|status|flush}"
98 # End $rc_base/init.d/squid