#!/bin/sh # # chkconfig: - 24 35 # description: Starts and stops the Kronosnet daemon. # # pidfile: # config: /etc/kronosnet/kronosnet.conf # # Kronosnet; http://kronosnet.org # Init file based on smbd's init file. # ### BEGIN INIT INFO # Provides: kronosnetd # Required-Start: $network # Required-Stop: $network # Should-Start: # Default-Start: # Default-Stop: 0 1 2 3 4 5 6 # Short-Description: Kronosnet is VPN on steroids. # Description: Kronosnet provides a TAP that uses multiple physical network # interfaces to create a highly available, secure and IPv4/IPv6 # compatible network transport. ### END INIT INFO BIN_NAME="kronosnetd" BIN_PATH="/usr/sbin/" CNF_PATH="/etc/kronosnet/kronosnet.conf" # Source function library. if [ -f /etc/init.d/functions ] ; then . /etc/init.d/functions elif [ -f /etc/rc.d/init.d/functions ] ; then . /etc/rc.d/init.d/functions else exit 1 fi RETVAL=0 OPT_START="" start() { echo -n $"Starting the kronosnet daemon: " daemon $BIN_NAME $OPT_START RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$BIN_NAME || \ RETVAL=1 return $RETVAL } stop() { echo -n $"Shutting down the kronosnet daemon: " killproc $BIN_NAME RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$BIN_NAME return $RETVAL } restart() { stop start } reload() { # Kronosnet daemon does not hangup yet. echo "Kronosnet daemon can not yet reload the config file. Restarting." restart #echo -n "Reloading $CNF_PATH file: " #killproc $BIN_NAME -HUP #RETVAL=$? #echo #return $RETVAL } rhstatus() { # kronosnetd doesn't write a PID file. PID=`pidof kronosnetd` if [ -n "$PID" ] then echo "Kronosnet daemon is running with PID: [$PID]" else echo "Kronosnet daemon is not running." fi } # Allow status check for users that will fail the next test. if [ "$1" = status ]; then rhstatus exit $? fi # Check that we can write to the config file. If not, then the user shouldn't # be doing anything other than checking the status. [ -w $CNF_PATH ] || exit 4 case "$1" in start) start ;; stop) stop ;; restart) restart ;; reload) reload ;; status) rhstatus ;; condrestart) [ -f /var/lock/subsys/smb ] && restart || : ;; *) echo $"Usage: $0 {start|stop|restart|reload|status|condrestart}" exit 2 esac exit $?