mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-29 13:00:32 +01:00
d4e8c61faf
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
59 lines
906 B
Bash
59 lines
906 B
Bash
#!/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
|