#! /bin/sh ### BEGIN INIT INFO # Provides: iked # Required-Start: $network resolvconf # Required-Stop: $network resolvconf # Default-Start: 3 4 5 # Default-Stop: 0 1 6 # Short-Description: start and stop iked daemon # Description: start and stop the Shrew Soft IKE daemon # ### END INIT INFO # sysctl net.ipv4.conf.all.rp_filter=0 parameter allow traffic in the tunnel # chkconfig: 345 13 87 # Source function library. . /etc/init.d/functions . /etc/sysconfig/network . /lib/lsb/init-functions IKED_BIN=/usr/sbin/iked test -x $IKED_BIN || exit 5 RETVAL=0 start() { gprintf "Starting Shrew Soft IKE daemon..." $IKED_BIN -D RETVAL=$? if [ $RETVAL = 0 ]; then touch /var/lock/subsys/iked success "%s startup" "$base" sysctl net.ipv4.conf.all.rp_filter=0 else failure "%s startup" "$base" fi echo return $RETVAL } stop() { gprintf "Stopping Shrew Soft IKE daemon..." killproc iked RETVAL=$? if [ $RETVAL = 0 ]; then rm -f /var/lock/subsys/iked success "%s stop" "$base" sysctl net.ipv4.conf.all.rp_filter=1 else failure "%s stop" "$base" fi echo return $RETVAL } restart() { stop start } RETVAL=0 # See how we were called. case "$1" in start) start ;; stop) stop ;; status) status iked ;; restart) restart ;; reload) reload ;; condrestart) [ -f /var/lock/subsys/iked ] && restart || : ;; *) gprintf "Usage: %s {start|stop|status|restart|condrestart}\n" "$0" exit 1 esac exit $RETVAL