summaryrefslogtreecommitdiff
path: root/system/uptimed/rc.uptimed
blob: 7425a88ed035af4a791aa50087dca1533aa503a1 (plain)
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
#!/bin/bash
#
# run control file for uptimed

RETVAL=0
NAME="uptimed"
UPTIMED="/usr/sbin/uptimed"
PIDFILE="/var/run/uptimed"

START="$UPTIMED"
if [ -e $PIDFILE ]; then
	STOP="kill $( cat $PIDFILE )"
else
	STOP="killall $UPTIMED"
fi
CREATEBOOTID="$UPTIMED -b"

start()
{
	echo -n $"Starting $NAME:"
	$START
	RETVAL=$?
	echo
}

stop()
{
	echo -n $"Stopping $NAME:"
	$STOP
	RETVAL=$?
	echo
}

createbootid()
{
	$CREATEBOOTID
	RETVAL=$?
	$POST
}

case "$1" in
	start)
		start
		;;
	stop)
		stop
		;;
	restart)
		stop
		start
		;;
	createbootid)
		createbootid
		;;
	*)
		echo $"Usage: $0 {start|stop|restart|createbootid}"
		RETVAL=1
esac
exit $RETVAL