summaryrefslogtreecommitdiff
path: root/ham/aprx/rc.aprx.new
diff options
context:
space:
mode:
authorJK Wood <joshuakwood@gmail.com>2014-07-23 07:58:31 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2014-07-23 07:58:31 +0700
commit56837f7a6b002042a0926e2b631b532bf6282f85 (patch)
tree3c066768e3a3536e9b470dc363d6726f0e9343c6 /ham/aprx/rc.aprx.new
parentd5f9d9675d355a89149c81217a06eb8a2389e830 (diff)
downloadslackbuilds-56837f7a6b002042a0926e2b631b532bf6282f85.tar.gz
ham/aprx: Added (APRS software package).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'ham/aprx/rc.aprx.new')
-rw-r--r--ham/aprx/rc.aprx.new69
1 files changed, 69 insertions, 0 deletions
diff --git a/ham/aprx/rc.aprx.new b/ham/aprx/rc.aprx.new
new file mode 100644
index 0000000000..d5cc498eca
--- /dev/null
+++ b/ham/aprx/rc.aprx.new
@@ -0,0 +1,69 @@
+#!/bin/sh
+#
+# aprx daemon control script.
+# Written for Slackware Linux by JK Wood <joshuakwood@gmail.com>
+
+BIN=/sbin/aprx
+CONF=/etc/aprx.conf
+PID=/var/run/aprx.pid
+
+aprx_start() {
+ # Sanity checks.
+ if [ ! -r $CONF ]; then # no config file, exit:
+ echo "$CONF does not appear to exist. Abort."
+ exit 1
+ fi
+
+ if [ -s $PID ]; then
+ echo "aprx appears to already be running?"
+ exit 1
+ fi
+
+ echo "Starting aprx daemon..."
+ if [ -x $BIN ]; then
+ $BIN -f $CONF
+ fi
+}
+
+aprx_stop() {
+ echo "Shutdown aprx gracefully..."
+ if [ -r $PID ]; then
+ kill -HUP $(cat $PID)
+ rm -f $PID
+ else
+ killall -HUP -q aprx
+ fi
+ echo
+}
+
+aprx_restart() {
+ aprx_stop
+ sleep 3
+ aprx_start
+}
+
+aprx_status() {
+ if [ -e $PID ]; then
+ echo "aprx is running."
+ else
+ echo "arpx is stopped."
+ exit 1
+ fi
+}
+
+case "$1" in
+ start)
+ aprx_start
+ ;;
+ stop)
+ aprx_stop
+ ;;
+ restart)
+ aprx_restart
+ ;;
+ status)
+ aprx_status
+ ;;
+ *)
+ echo "usage: `basename $0` {start|stop|restart|status}"
+esac