#!/bin/bash # runlevelscript for capi4linux # Comments to support chkconfig # chkconfig: 2345 08 93 # description: provides the basic capi subsystem # # /etc/rc.d/init.d/capi4linux SERVICE=capi4linux LOCKFILE=/var/lock/subsys/$SERVICE test -x /usr/sbin/capiinit || exit 0 # Source function library. . /etc/rc.d/init.d/functions RETVAL=0 # See how we were called. case "$1" in start) gprintf "Starting capi4linux: " [ ! -c /dev/capi20 ] && mknod /dev/capi20 c 68 0 daemon capiinit start RETVAL=$? [ $RETVAL == 0 ] && touch $LOCKFILE echo ;; stop) gprintf "Shutting down capi4linux: " daemon capiinit stop RETVAL=$? [ $RETVAL == 0 ] && touch $LOCKFILE echo ;; status) gprintf "capi4linux is" capiinit show &> /dev/null && \ ( gprintf " running " ; success ; gprintf "\n" ) || \ ( gprintf "not running " ; failed ; gprintf "\n" ) ;; restart) $0 stop $0 start RETVAL=$? ;; *) gprintf "Usage: %s {start|stop|show|restart}" "$0" exit 1 esac exit $RETVAL