#!/bin/bash # SimpleHelp Daemon # chkconfig: 345 20 80 # description: Newer style initd script for SimpleHelp server SIMPLEHELP_PATH="/opt/SimpleHelp" SCRIPTNAME=/etc/init.d/simplehelp case "$1" in start) printf "%-50s" "Starting SimpleHelp Server..." cd $SIMPLEHELP_PATH sh serverstart.sh printf "%s\n" "Ok" ;; status) printf "%-50s" "Checking SimpleHelp Server..." if [ -z "`ps axf | grep ProxyServerStartup | grep -v grep`" ]; then printf "%s\n" "SimpleHelp not running" else echo "%s\n" "Running" fi ;; stop) printf "%-50s" "Stopping SimpleHelp Server" cd $SIMPLEHELP_PATH sh serverstop.sh printf "%s\n" "Ok" ;; restart) $0 stop $0 start ;; *) echo "Usage: $0 {status|start|stop|restart}" exit 1 esac