summaryrefslogtreecommitdiff
path: root/wmiistatus.init
diff options
context:
space:
mode:
authorMichael Stapelberg <michael+x200@stapelberg.de>2008-10-04 19:32:35 +0200
committerMichael Stapelberg <michael+x200@stapelberg.de>2008-10-04 19:32:35 +0200
commite31a85eb3b9d331d73254ceb2d6156cc8e66c40a (patch)
tree436738c1d8a3e50551d45182523599430a337ebc /wmiistatus.init
parente68449ee1db529d0ef7b88fb0fba15263445b574 (diff)
Make some formats/paths configurable, add initscript
Diffstat (limited to 'wmiistatus.init')
-rwxr-xr-xwmiistatus.init35
1 files changed, 35 insertions, 0 deletions
diff --git a/wmiistatus.init b/wmiistatus.init
new file mode 100755
index 0000000..576340f
--- /dev/null
+++ b/wmiistatus.init
@@ -0,0 +1,35 @@
+#!/bin/sh
+#
+### BEGIN INIT INFO
+# Provides: wmiistatus
+# Required-Start:
+# Required-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: little application to fill up wmii's status bar
+# Description: little application to fill up wmii's status bar
+### END INIT INFO
+
+# For the pidfile, you must be root. wmiistatus itself runs as user just fine
+[ $UID -eq 0 ] || { echo "You need to be root"; exit 1; }
+
+. /lib/lsb/init-functions
+
+case "$1" in
+start) log_daemon_msg "Starting wmii status bar filler" "wmiistatus"
+ start-stop-daemon --start --background --quiet --make-pidfile --pidfile /var/run/wmiistatus.pid --name wmiistatus --startas /usr/bin/wmiistatus
+ log_end_msg $?
+ ;;
+stop) log_daemon_msg "Stopping wmii status bar filler" "wmiistatus"
+ start-stop-daemon --stop --quiet --pidfile /var/run/wmiistatus.pid --name wmiistatus
+ log_end_msg $?
+ ;;
+restart|reload|force-reload) log_daemon_msg "Restarting wmii status bar filler" "wmiistatus"
+ start-stop-daemon --stop --retry 5 --quiet --pidfile /var/run/wmiistatus.pid --name wmiistatus
+ start-stop-daemon --start --background --quiet --make-pidfile --pidfile /var/run/wmiistatus.pid --name wmiistatus --startas /usr/bin/wmiistatus
+ ;;
+*) log_action_msg "Usage: $0 {start|stop|restart|reload|force-reload}"
+ exit 2
+ ;;
+esac
+exit 0