]>
git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/initscripts/init.d/squid
2 # Begin $rc_base/init.d/squid
7 chown
-R squid
:squid
/var
/log
/squid
8 chown
-R squid
:squid
/var
/log
/squidGuard
13 eval $
(/usr
/local
/bin
/readhash
/var
/ipfire
/ethernet
/settings
)
14 eval $
(/usr
/local
/bin
/readhash
/var
/ipfire
/proxy
/settings
)
16 # If the proxy port is not set we set the default to 800.
17 if [ -z $PROXY_PORT ]; then
21 LOCALIP
=`cat /var/ipfire/red/local-ipaddress | tr -d \n`
22 if [ -z $LOCALIP ]; then
23 boot_mesg
"Couldn't read local-ipaddress" ${FAILURE}
28 FILE
=/var
/ipfire
/vpn
/config
32 CONN_TYPE
=`echo "$LINE" | awk -F, '{ print $5 }'`
33 if [ "$CONN_TYPE" != "net" ]; then
36 iptables
-t nat
-A SQUID
-i $1 -p tcp
-d `echo "$LINE" | awk -F, '{ print $13 }'` --dport 80 -j RETURN
39 if [ "$RED_TYPE" == "STATIC" ]; then
40 iptables
-t nat
-A SQUID
-i $1 -p tcp
-d $RED_NETADDRESS/$RED_NETMASK --dport 80 -j RETURN
43 iptables
-t nat
-A SQUID
-i $1 -p tcp
-d $LOCALIP --dport 80 -j RETURN
45 iptables
-t nat
-A SQUID
-i $1 -p tcp
--dport 80 -j REDIRECT
--to-port $PROXY_PORT
52 if [ -n "${pidlist}" ]; then
53 echo -e "Squid is already running with Process"\
54 "ID(s) ${pidlist}.${NORMAL}"
58 if [ -e /var
/ipfire
/proxy
/enable -o -e /var
/ipfire
/proxy
/enable_blue
]; then
59 boot_mesg
"Starting Squid Proxy Server..."
60 loadproc
/usr
/sbin
/squid
-D -z >/dev
/null
2>&1
61 loadproc
/usr
/sbin
/squid
-D
64 eval $
(/usr
/local
/bin
/readhash
/var
/ipfire
/ethernet
/settings
)
66 if [ -e /var
/ipfire
/proxy
/transparent
]; then
67 transparent
$GREEN_DEV
69 if [ -e /var
/ipfire
/proxy
/transparent_blue
]; then
75 iptables
-t nat
-F SQUID
76 if [ -e /var
/run
/squid.pid
]; then
77 boot_mesg
"Stopping Squid Proxy Server..."
78 squid
-k shutdown
>/dev
/null
2>&1
80 killproc
/usr
/bin
/squidGuard
>/dev
/null
81 killproc
/usr
/sbin
/updxlrator
>/dev
/null
82 killproc
/usr
/sbin
/squid
>/dev
/null
83 rm -rf /var
/run
/squid.pid
94 statusproc
/usr
/sbin
/squid
95 statusproc
/usr
/lib
/squid
/unlinkd
100 echo > /var
/log
/cache
/swap.state
101 chown squid.squid
/var
/log
/cache
/swap.state
107 echo "Usage: $0 {start|stop|restart|status|flush}"
112 # End $rc_base/init.d/squid