All pastes #896905 Raw Edit

rc script

public shellscript v1 · immutable
·published 2008-02-09 01:06 UTC
rendered paste body
#!/bin/bash. /etc/rc.conf. /etc/rc.d/functions[ -x /usr/bin/certmaster ] || exit 0SERVICE=certmasterPROCESS=certmasterDAEMON=/usr/bin/certmasterCONFIG_ARGS="--daemon"PID=`pidof -o %PPID $DAEMON`start () {        stat_busy "Starting $PROCESS"        [ -z "$PID" ] && $DAEMON        RETVAL=$?        if [ $RETVAL -gt 0 ]; then                stat_fail        else                add_daemon $PROCESS $CONFIG_ARGS        fi        stat_done}stop () {        stat_busy "Stopping $PROCESS"        [ ! -z "$PID" ] && kill $PID &> /dev/null        RETVAL=$?        if [ $RETVAL -gt 0]; then                stat_fail        else                rm_daemon $PROCESS                stat_done        fi}restart () {        stop        start}case "$1" in        start|stop|restart)          $1          ;;        *)          echo $"Usage : $0 {start|stop|restart}"          exhit 1          ;;esacexit $RETVAL