summaryrefslogtreecommitdiff
path: root/startup-scripts/archlinux-startup.sh
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2014-07-09 16:04:58 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2014-07-09 16:04:58 +0200
commit819a9ab222da57d6064a7cc9ad3e2c9ff0ef2f82 (patch)
tree5a175f83ca99f08c81f9dd2be93649fd97eebdaa /startup-scripts/archlinux-startup.sh
Imported Upstream version 0.6upstream/0.6
Diffstat (limited to 'startup-scripts/archlinux-startup.sh')
-rwxr-xr-xstartup-scripts/archlinux-startup.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/startup-scripts/archlinux-startup.sh b/startup-scripts/archlinux-startup.sh
new file mode 100755
index 0000000..4d3c8fd
--- /dev/null
+++ b/startup-scripts/archlinux-startup.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PID=$(pidof -o %PPID /usr/sbin/downtimed)
+case "$1" in
+ start)
+ stat_busy "Starting downtimed"
+ [ -z "$PID" ] && /usr/sbin/downtimed
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon downtimed
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping downtimed"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon downtimed
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0