Fbb start file
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | #! /bin/bash ### BEGIN INIT INFO # Provides: F6FBB Start-up # Required-Start: $remote_fs $syslog $network # Required-Stop: $remote_fs $syslog $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: FBB start up # Description: This script provides the start/stop control # for the FBB BBS Packet Radio BBS. ### END INIT INFO export PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/etc/ax25:/usr/local/etc/ax25:/usr/local/xnet base=${0##*/} link=${base#*[SK][0-9][0-9]} test $link = $base && START_FBB=yes test "$START_FBB" = yes || exit 0 test -x /usr/local/sbin/fbb || exit 0 return="Done" case "$1" in start) echo "Starting FBB daemon " if [ -f /usr/local/etc/ax25/fbb/fbb.conf ] ; then /usr/local/sbin/fbb -s -a -l /etc/ax25/fbb.log || return=$rc_failed else echo "/usr/local/etc/ax25/fbb/fbb.conf file not found" return="Failed" fi echo " $1 $return" ;; stop) echo "Shutting down FBB script" killall -KILL fbb || return="Failed" echo "Shutting down FBB daemon" killall -KILL xfbbd || return="Failed" sleep 4 echo " $1 $return" ;; restart|reload) $0 stop && $0 start ;; status) echo -n "Checking for FBB daemon: " PID=`/bin/pidof -x xfbbd` if [ -n "$PID" ]; then echo "FBB is up" else echo "No FBB daemon" fi ;; *) echo "Usage: $0 {start|stop|status|restart}" exit 1 esac exit 0 |