#! /bin/bash # # freeb Start/Stop the freeb daemon. # # chkconfig: 345 92 8 # description: freeb is an insurance billing printing daemon that \ # works with the OpenEMR medical record software program # processname: freeb # pidfile: /var/run/freeb.pid # # Above pidfile will NOT be made # # Date: 3/23/2006 # Author: Brady Miller email:brady@sparmy.com # # This is a very alpha version. Use at your own risk. # I am not responsible for any bad things that happen. # Source function library. . /etc/init.d/functions # Source the /etc/default/freeb file if it exist. #if [ -f /etc/default/freeb ]; then # . /etc/default/freeb # fi # Some defaults freeb="/usr/share/freeb/bin/FreeB_Server.pl" prog="freeb" RETVAL=0 start() { gprintf "Starting %s: " "$prog" #daemon command not working with '&', some binary error #so will just run without daemon command, should be fine, #A pid file will not be made $freeb & < /dev/null echo " [homemade OK]" RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/freeb return $RETVAL } stop() { gprintf "Stopping %s: " "$prog" killproc $freeb RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/freeb return $RETVAL } rhstatus() { status $freeb } restart() { stop start } case "$1" in start) start ;; stop) stop ;; restart) restart ;; status) rhstatus ;; *) gprintf "Usage: %s {start|stop|restart}\n" "$0" exit 1 esac exit $?