diff options
author | Graham Orange <gorange40@gmail.com> | 2014-04-11 01:18:22 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2014-04-11 01:24:12 +0700 |
commit | d4e8c61fafba3b438ef7a19403305b09e8d0f6eb (patch) | |
tree | 04c7c49e501c82640c636a391c756b3f82ae6fa8 /system/uptimed/rc.uptimed | |
parent | 96c3b4238ea54b45be6f47b3628372f929235854 (diff) | |
download | slackbuilds-d4e8c61fafba3b438ef7a19403305b09e8d0f6eb.tar.gz |
system/uptimed: Added (An uptime daemon).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/uptimed/rc.uptimed')
-rw-r--r-- | system/uptimed/rc.uptimed | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/system/uptimed/rc.uptimed b/system/uptimed/rc.uptimed new file mode 100644 index 0000000000..b27a36b342 --- /dev/null +++ b/system/uptimed/rc.uptimed @@ -0,0 +1,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 |