File: atm-tools.atm

package info (click to toggle)
linux-atm 1%3A2.5.1-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,720 kB
  • sloc: ansic: 36,145; sh: 9,525; yacc: 1,193; lex: 556; makefile: 324; perl: 186; awk: 1
file content (58 lines) | stat: -rw-r--r-- 1,375 bytes parent folder | download | duplicates (2)
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
#!/bin/sh -e
### BEGIN INIT INFO
# Provides:          atm
# Required-Start:    $local_fs
# Required-Stop:     $local_fs
# X-Start-Before:    networking
# X-Stop-After:      networking
# Default-Start:     S
# Default-Stop:      
# Short-Description: Start/stop the atm daemon(s).
### END INIT INFO

DAEMON='/usr/sbin/atmarpd'
PIDFILE='/run/atmarpd.pid'
DEFAULTS='/etc/default/atm'

test -f $DAEMON || exit 0

. /lib/lsb/init-functions

OPTIONS='-l syslog'
START_DAEMON='yes'

[ -r "$DEFAULTS" ] && . "$DEFAULTS"

if [ "$START_DAEMON" != "yes" -a "$1" != "stop" ]; then
	echo "Edit /etc/default/atm to start atmarpd."
	exit 0
fi

sendsigs_omit() {
	local omitdir=/run/sendsigs.omit.d
	[ -d $omitdir ] || return 0
	ln -sf $PIDFILE $omitdir/atmarpd
}

case "$1" in
start)  echo -n "Starting ATM ARP Daemon: "
        start-stop-daemon --start --quiet --background --make-pidfile \
                --pidfile $PIDFILE --exec $DAEMON -- $OPTIONS
        echo "atmarpd."
        sendsigs_omit
        ;;
stop)   echo -n "Stopping ATM ARP Daemon: "
        start-stop-daemon --stop --quiet --oknodo \
                --pidfile $PIDFILE --name atmarpd
        rm -f $PIDFILE
        echo "atmarpd."
        ;;
restart|force-reload)
        $0 stop
        $0 start
        ;;
*)      echo "Usage: /etc/init.d/atm start|stop|restart|force-reload"
        exit 2
        ;;
esac
exit 0