diff options
author | Gustavo Conrad - LU8WFY <gusconrad@gmail.com> | 2014-07-24 01:13:03 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2014-07-24 01:13:03 +0700 |
commit | ee8de43cf3d0056ec019046c39719a6999b64fa2 (patch) | |
tree | ebcd144529f495b5dee54ab4570451052485750c /ham/svxlink/rc.svxlink | |
parent | ba80f04f0220336ebca3a23899e63bb925c63652 (diff) | |
download | slackbuilds-ee8de43cf3d0056ec019046c39719a6999b64fa2.tar.gz |
ham/svxlink: Added (voice service system).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'ham/svxlink/rc.svxlink')
-rw-r--r-- | ham/svxlink/rc.svxlink | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/ham/svxlink/rc.svxlink b/ham/svxlink/rc.svxlink new file mode 100644 index 0000000000..0b50a77f46 --- /dev/null +++ b/ham/svxlink/rc.svxlink @@ -0,0 +1,57 @@ +#!/bin/sh +# Start/stop/restart svxlink. + +# Start svxlink: +svxlink_start() { + # CMDLINE="/usr/bin/svxlink --daemon --runasuser=svxlink --pidfile=/var/run/svxlink.pid --logfile=/var/log/svxlink" + CMDLINE="/usr/bin/svxlink --daemon --runasuser=svxlink --pidfile=/var/run/svxlink.pid" + echo -n "Starting SvxLink: $CMDLINE" + $CMDLINE + echo +} + +# Stop svxlink: +svxlink_stop() { + echo -n "Stopping SvxLink..." + if [ -r /var/run/svxlink.pid ]; then + kill $(cat /var/run/svxlink.pid) + rm -f /var/run/svxlink.pid + else + killall -q svxlink + fi + echo +} + +# Restart svxlink: +svxlink_restart() { + svxlink_stop + sleep 1 + svxlink_start +} + +# Check if svxlink is running: +svxlink_status() { + if [ -e /var/run/svxlink.pid ]; then + echo "SvxLink is running." + else + echo "SvxLink is stopped." + exit 1 + fi +} + +case "$1" in +'start') + svxlink_start + ;; +'stop') + svxlink_stop + ;; +'restart') + svxlink_restart + ;; +'status') + svxlink_status + ;; +*) + echo "usage $0 start|stop|restart|status" +esac |