2014-04-10 20:18:22 +02:00
|
|
|
#!/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
|
2015-11-04 18:28:30 +01:00
|
|
|
STOP="kill $( cat $PIDFILE )"
|
2014-04-10 20:18:22 +02:00
|
|
|
else
|
2015-11-04 18:28:30 +01:00
|
|
|
STOP="killall $UPTIMED"
|
2014-04-10 20:18:22 +02:00
|
|
|
fi
|
|
|
|
CREATEBOOTID="$UPTIMED -b"
|
|
|
|
|
|
|
|
start()
|
|
|
|
{
|
2015-11-04 18:28:30 +01:00
|
|
|
echo -n $"Starting $NAME:"
|
|
|
|
$START
|
|
|
|
RETVAL=$?
|
|
|
|
echo
|
2014-04-10 20:18:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
stop()
|
|
|
|
{
|
2015-11-04 18:28:30 +01:00
|
|
|
echo -n $"Stopping $NAME:"
|
|
|
|
$STOP
|
|
|
|
RETVAL=$?
|
|
|
|
echo
|
2014-04-10 20:18:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
createbootid()
|
|
|
|
{
|
2015-11-04 18:28:30 +01:00
|
|
|
$CREATEBOOTID
|
|
|
|
RETVAL=$?
|
|
|
|
$POST
|
2014-04-10 20:18:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
case "$1" in
|
2015-11-04 18:28:30 +01:00
|
|
|
start)
|
|
|
|
start
|
2014-04-10 20:18:22 +02:00
|
|
|
;;
|
2015-11-04 18:28:30 +01:00
|
|
|
stop)
|
|
|
|
stop
|
|
|
|
;;
|
|
|
|
restart)
|
|
|
|
stop
|
|
|
|
start
|
|
|
|
;;
|
|
|
|
createbootid)
|
|
|
|
createbootid
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo $"Usage: $0 {start|stop|restart|createbootid}"
|
|
|
|
RETVAL=1
|
2014-04-10 20:18:22 +02:00
|
|
|
esac
|
|
|
|
exit $RETVAL
|