#!/bin/sh # Start/stop g2_ircddb # ### BEGIN INIT INFO # Provides: g2_ircddb # Required-Start: $null # Required-Stop: $null # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: g2_ircddb # Description: g2_ircddb ### END INIT INFO . /lib/lsb/init-functions IRCDDB_EXE=/usr/local/bin/g2_ircddb IRCDDB_CFG=/usr/local/etc/g2_ircddb.cfg IRCDDB_LOG=/var/log/g2_ircddb.log start() { status_of_proc g2_ircddb >/dev/null RETVAL=$? if [ "$RETVAL" = "0" ] ; then echo "g2_ircddb already running" else echo -n "Starting g2_ircddb" start-stop-daemon --exec $IRCDDB_EXE -S $IRCDDB_CFG > $IRCDDB_LOG 2>&1 & log_end_msg $? fi } stop() { start-stop-daemon --exec $IRCDDB_EXE --retry 5 -K } case "$1" in start) start ;; stop) stop ;; restart) stop start ;; status) echo -n "g2_ircddb " status_of_proc g2_ircddb ;; *) log_action_msg "Usage: /etc/init.d/g2_ircddb {start|stop|restart|status}" exit 2 ;; esac exit 0