3 # ggsn This shell script takes care of starting and stopping
7 # description: ggsn is a Gateway GPRS Support Node.
9 # Source function library.
10 .
/etc
/rc.d
/init.d
/functions
12 # Source networking configuration.
13 .
/etc
/sysconfig
/network
15 if [ -f /etc
/sysconfig
/ggsn
]; then
19 # Check that networking is up.
20 [ ${NETWORKING} = "no" ] && exit 0
22 [ -f /usr
/bin
/ggsn
] ||
exit 0
23 [ -f /etc
/ggsn.conf
] ||
exit 0
30 echo -n $
"Starting $prog: "
33 /sbin
/modprobe tun
>/dev
/null
2>&1
35 # Enable routing of packets: WARNING!!!
36 # Users should enable this explicitly
37 # echo 1 > /proc/sys/net/ipv4/ip_forward
39 # Check for runtime directory of nonvolatile data
40 if [ ! -d /var
/lib
/ggsn
]; then
44 # Check for GTP restart counter
45 if [ ! -d /var
/lib
/ggsn
/gsn_restart
]; then
46 echo 0 > /var
/lib
/ggsn
/gsn_restart
53 [ $RETVAL -eq 0 ] && touch /var
/lock
/subsys
/ggsn
59 echo -n $
"Shutting down $prog: "
63 [ $RETVAL = 0 ] && rm -f /var
/lock
/subsys
/ggsn
/var
/run
/ggsn.pid
67 # See how we were called.
81 if [ -f /var
/lock
/subsys
/ggsn
] ; then
92 echo $
"Usage: $0 {start|stop|restart|condrestart|status}"