RMA Startup script for Red Hat 9
Posted: Thu Sep 08, 2005 12:26 am
how to add Startup sciprt for Redt Hat 9 that make it start automatic ?
thx a lot
thx a lot
Code: Select all
#!/bin/sh
# chkconfig: 2345 20 80
# description: Hostmonitor RMA
RMA_PWD="/opt/hostmonitor"
RMA_BIN="${RMA_PWD}/rma"
RMA_INI="${RMA_PWD}/rma.ini"
case "${1}" in
start)
echo -n "Starting Hostmonitor RMA: "
${RMA_BIN} -d ${RMA_INI} &>/dev/null
echo "done"
;;
stop)
echo -n "Stopping Hostmonitor RMA: "
PID="$(ps ax | grep ${RMA_BIN} | grep -v grep | awk '{print $1}')"
if [ x"${PID}" != x"" ]; then
kill ${PID} &>/dev/null
sleep 1
kill -9 ${PID} &>/dev/null
fi
echo "done"
;;
restart)
${0} stop
sleep 1
${0} start
;;
*)
echo "Usage: `basename ${0}` <start|stop|restart>"
exit 1
;;
esac
exit 0