summaryrefslogtreecommitdiff
path: root/i3status.init
blob: fa30339f81fab5242e3f85dd8cbaa2e0f28b2ecd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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
[ $(id -ru) -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