Blob Blame History Raw
#!/bin/bash
#
# aprsd.init for version 2.2.5.  starts or stops aprsd server.
# This file should be placed in /etc/rc.d/init.d/
#
# chkconfig: - 60 50
# description: APRSd is an APRS server program that uses amateur radio and internet#
#		services to convey GPS mapping, weather, and positional data.
#		It has been developed by and for amateur radio enthusiasts to provide
#		real-time data in an easy to use package.
# processname: aprsd
# config: /etc/aprsd/aprsd.conf

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

[ -x /usr/bin/aprsd ] || exit 0

RETVAL=0
prog="aprsd"

start() {
        # Start daemons.

        if [ -d /etc/aprsd ] ; then
                        echo -n $"Starting $prog: "
                        daemon /usr/bin/aprsd -d
                        RETVAL=$?
                        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/aprsd
                        echo
        else
                RETVAL=1
        fi
        return $RETVAL
}

stop() {
        # Stop daemons.
        echo -n $"Shutting down $prog: "
        killproc $prog
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/aprsd
        return $RETVAL
}

# See how we were called.
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart|reload)
        stop
        start
        RETVAL=$?
        ;;
  condrestart)
        if [ -f /var/lock/subsys/aprsd ]; then
            stop
            start
            RETVAL=$?
        fi
        ;;
  status)
        status $prog
        RETVAL=$?
        ;;
  *)
        echo $"Usage: $0 {start|stop|restart|condrestart|status}"
        exit 1
esac

exit $RETVAL