#!/bin/bash # # chkconfig: 2345 80 05 # Description: ASSP init.d script # Hacked by : How2CentOS - http://www.how2centos.com # Get function from functions library . /etc/init.d/functions # Start the service ASSP start() { echo -n "Starting ASSP server: " cd /usr/share/ASSP perl assp.pl 2>&1 > /dev/null & ### Create the lock file ### touch /var/lock/subsys/ASSP success $"ASSP server startup" echo } # Restart the service ASSP stop() { echo -n "Stopping ASSP server: " kill -9 `ps ax | grep "perl assp.pl" | grep -v grep | awk '{ print $1 }'` ### Now, delete the lock file ### rm -f /var/lock/subsys/ASSP success $"ASSP server shutdown" echo } ### main logic ### case "$1" in start) start ;; stop) stop ;; status) status ASSP ;; restart|reload|condrestart) stop start ;; *) echo $"Usage: $0 {start|stop|restart|reload|status}" exit 1 esac exit 0