#!/bin/bash # # pnet This shell script takes care of registering and unregistering # the kernel bin_fmt # # chkconfig: 2345 80 30 # description: This program enables you to run C# programs using a \ # point & click in GNU/Linux # Source function library. [ -f /etc/init.d/functions ] && . /etc/init.d/functions # replacement function for the poor souls who don't have Redhat [ -f /etc/init.d/functions ] || echo_failure() { echo " FAILED "; } [ -f /etc/init.d/functions ] || echo_success() { echo " ok "; } [ -f /usr/local/bin/ilrun ] || exit 0 RETVAL=0 prog="pnet" start() { # Start daemons. echo -n $"Starting $prog: " /usr/local/bin/ilrun --register RETVAL=$? [ $RETVAL = 0 ] && echo_success [ $RETVAL = 0 ] || echo_failure echo return $RETVAL } stop() { # Stop daemons. echo -n $"Shutting down $prog: " /usr/local/bin/ilrun --unregister RETVAL=$? [ $RETVAL = 0 ] && echo_success [ $RETVAL = 0 ] || echo_failure echo return $RETVAL } # See how we were called. case "$1" in start) start ;; stop) stop ;; restart|reload) stop start RETVAL=$? ;; *) echo $"Usage: $0 {start|stop|restart}" exit 1 esac exit $RETVAL