File: aprx.init

package info (click to toggle)
aprx 2.9.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,352 kB
  • sloc: ansic: 15,809; sh: 598; makefile: 160
file content (84 lines) | stat: -rwxr-xr-x 1,617 bytes parent folder | download | duplicates (3)
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/bash
#
# chkconfig: - 16 84
# description: Start up a receive only APRS igate
# processname: aprx
# config: /etc/sysconfig/aprx

### BEGIN INIT INFO  -- debian style:
# Provides: aprx
# Required-Start: $syslog $local_fs
# Required-Stop:  $syslog $local_fs
# Default-Stop:   0 1 6
# Short-Description: start and stop aprx
# Description: Monitor and gateway radio amateur APRS radio network datagrams
### END INIT INFO

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

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

# defaults

PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/aprx
NAME=aprx
DESC="aprx igate"

# source the config, if it exists
if [ -f /etc/sysconfig/aprx ] ; then
   . /etc/sysconfig/aprx
fi

test -x $DAEMON || exit 0

if [ "$STARTAPRX" != "yes" ];then
	echo "Starting of $NAME not enabled in /etc/sysconfig/$NAME."
	exit 0
fi

set -e


case "$1" in
  start)
	echo -n $"Starting aprx server: "
	$DAEMON
	disown -ar
	usleep 500000
	status $NAME &> /dev/null && echo_success || echo_failure
	RETVAL=$?
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$NAME
	echo
	;;
  stop)
	echo -n $"Shutting down aprx server: "
	killproc $DAEMON
	RETVAL=$?
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$NAME
	echo_success
	;;
  restart|reload)
        $0 stop
        $0 start
	RETVAL=$?
        ;;
  condrestart)
        if [ -f /var/lock/subsys/$NAME ]; then
                $0 stop
		$0 start
        fi
	RETVAL=$?
        ;;
  status)
        status $NAME
	RETVAL=$?
        ;;
  *)
	echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
	exit 1
esac

exit $RETVAL