#!/bin/bash # # /etc/rc.d/init.d/gw6c # # Starts the gw6c service # # chkconfig: 345 95 5 # description: Runs the IPv6 tunnel from go6.net # processname: gw6c # Source function library. . /etc/init.d/functions test -x /usr/local/gw6c/bin/gw6c || exit 0 RETVAL=0 # # See how we were called. # prog="gw6c" start() { # Check if gw6c is already running if [ ! -f /var/lock/subsys/gw6c ]; then echo -n $"Starting $prog: " daemon /usr/local/gw6c/bin/gw6c -f /usr/local/gw6c/etc/gw6c.conf RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/gw6c echo fi return $RETVAL } stop() { pidof radvd >/dev/null && ( echo -n $"Stopping radvd: " killproc /usr/sbin/gw6c ) echo -n $"Stopping $prog: " killproc /usr/gw6c/bin/gw6c RETVAL=$? rm -f /var/lock/subsys/gw6c echo return $RETVAL } restart() { stop start } reload() { restart } case "$1" in start) start ;; stop) stop ;; reload|restart) restart ;; condrestart) if [ -f /var/lock/subsys/gw6c ]; then restart fi ;; *) echo $"Usage: $0 {start|stop|restart|condrestart}" exit 1 esac exit $? exit $RETVAL