acarsdec

an ACARS decoder
git clone git://r-36.net/acarsdec
Log | Files | Refs | README

acarsdec.archlinux (807B)


      1 #!/bin/bash
      2 
      3 CONF=/etc/conf.d/acarsdec
      4 
      5 . /etc/rc.conf
      6 . /etc/rc.d/functions
      7 
      8 [ -f $CONF ] && . $CONF
      9 
     10 ACARSDECBIN=/usr/bin/acarsdec
     11 STDINSRV=/usr/bin/stdinsrv
     12 APID=`pidof -x $ACARSDECBIN`
     13 case "$1" in
     14   force)
     15     stat_busy "Killing acarsdec by force."
     16     kill $APID &> /dev/null
     17     stat_done
     18     ;;
     19   start)
     20     stat_busy "Starting acarsdec server"
     21     [ -z "$APID" ] && $ACARSDECBIN $ACARSDECPARAMS \
     22 	    | $STDINSRV $STDINSRVPARAMS 2>&1 >> /dev/null &
     23     if [ $? -gt 0 ]; then
     24       stat_fail
     25     else
     26       add_daemon acarsdec 
     27       stat_done
     28     fi
     29     ;;
     30   stop)
     31     stat_busy "Stopping acarsdec"
     32     [ ! -z "$APID" ]  && kill $APID &>/dev/null
     33     rm_daemon acarsdec 
     34     stat_done
     35     ;;
     36   restart)
     37     $0 stop
     38     $0 start
     39     ;;
     40   *)
     41     echo "usage: $0 {start|stop|restart}"  
     42 esac
     43 exit 0
     44