File: atm-tools.atm

package info (click to toggle)
linux-atm 1%3A2.5.1-1.5
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 7,512 kB
  • ctags: 4,814
  • sloc: ansic: 36,137; sh: 9,573; yacc: 1,193; lex: 556; makefile: 325; perl: 186; awk: 1
file content (56 lines) | stat: -rw-r--r-- 1,344 bytes parent folder | download
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
#!/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='/sbin/atmarpd'
PIDFILE='/run/atmarpd.pid'
DEFAULTS='/etc/default/atm'

test -f $DAEMON || exit 0

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