File: ud.init

package info (click to toggle)
ud 0.7.1-13
  • links: PTS
  • area: main
  • in suites: woody
  • size: 276 kB
  • ctags: 38
  • sloc: ansic: 704; sh: 522; makefile: 69
file content (42 lines) | stat: -rw-r--r-- 917 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
#!/bin/sh
#
# Startup script for the Uptime daemon
#
# description: Uptime daemon tracks your best 3 uptimes.
#

FLAGS="defaults 50"
DAEMON=/usr/bin/ud
ARGS=`cat /etc/ud/config`

test -f $DAEMON || exit 0

case "$1" in
  start)
	echo -n "Starting uptime daemon: ud"
	start-stop-daemon --start --quiet --pidfile /var/run/ud.pid \
                --exec $DAEMON -- $ARGS
	echo "."
	;;
  stop)
	echo -n "Stopping uptime daemon: ud"
	start-stop-daemon --stop --quiet --pidfile /var/run/ud.pid \
                --exec $DAEMON
	echo "."
	;;
  restart|force-reload)
        echo "Restarting uptime daemon: ud"
	start-stop-daemon --stop --quiet --pidfile /var/run/ud.pid \
                --exec $DAEMON
        sleep 1
	start-stop-daemon --start --quiet --pidfile /var/run/ud.pid \
                --exec $DAEMON -- $ARGS
        ;;
  *)
	echo "Usage: ud {start|stop|restart|force-reload}"
	exit 1
        ;;
esac

exit 0