#!/bin/sh # # $Id: 3dmd.init.d,v 1.0 2003/22/10 18:56:35 seth Exp $ # # It is not safe to start if we don't have a default configuration... if [ ! -f /etc/3dmd.conf ]; then echo "/etc/3dmd.conf does not exist! - Aborting..." exit 1 fi 3DMDPID=/var/run/3dmd.pid case "$1" in start) echo -n "Starting 3dmd monitor: " start-stop-daemon --start --quiet --pidfile $3DMDPID \ --exec /usr/sbin/3dmd sleep 2 if [ -f "$3DMDPID" ] && ps h `cat "$3DMDPID"` >/dev/null; then echo "3dmd." else echo "3dmd failed to start - check syslog for diagnostics." fi ;; stop) echo -n "Stopping 3dmd monitor: 3dmd" start-stop-daemon --stop --quiet --pidfile $3DMDPID echo "." ;; restart | force-reload) $0 stop sleep 2 $0 start ;; *) echo "Usage: /etc/init.d/3dmd {start|stop|restart|force-reload}" exit 1 esac exit 0