i3status/debian/i3status.i3status-wmii.init

50 lines
1.7 KiB
Plaintext
Raw Normal View History

2009-06-21 12:51:32 +00:00
#!/bin/sh
#
### BEGIN INIT INFO
# Provides: i3status-wmii
2009-08-17 22:11:04 +00:00
# Required-Start: $remote_fs $network
# Required-Stop: $remote_fs $network
2009-06-21 12:51:32 +00:00
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Generates a status line for wmii
2009-08-17 22:11:04 +00:00
# Description: Combines several system information into a status line for
# wmii.
2009-06-21 12:51:32 +00:00
### END INIT INFO
2009-08-17 22:11:04 +00:00
need_root() {
# For the pidfile, you must be root. i3status itself works as user
[ $(id -ru) -eq 0 ] || { echo "You need to be root"; exit 1; }
}
2009-06-21 12:51:32 +00:00
[ -f /etc/default/i3status-wmii ] && . /etc/default/i3status-wmii
if [ "$I3STATUS_WMII_ENABLE" != "yes" ]
then
2009-08-17 22:11:04 +00:00
echo "Not starting i3status-wmii (Not enabled in /etc/default/i3status-wmii)"
2009-06-21 12:51:32 +00:00
exit 0
fi
. /lib/lsb/init-functions
case "$1" in
2009-08-17 22:11:04 +00:00
start) need_root
log_daemon_msg "Starting wmii status bar filler" "i3status-wmii"
2009-06-21 12:51:32 +00:00
start-stop-daemon --start --background --quiet --make-pidfile --pidfile /var/run/i3status-wmii.pid --name i3status-wmii --startas /usr/bin/i3status-wmii
log_end_msg $?
;;
2009-08-17 22:11:04 +00:00
stop) need_root
log_daemon_msg "Stopping wmii status bar filler" "i3status-wmii"
2009-06-21 12:51:32 +00:00
start-stop-daemon --stop --quiet --pidfile /var/run/i3status-wmii.pid --name i3status-wmii
log_end_msg $?
;;
2009-08-17 22:11:04 +00:00
restart|reload|force-reload) need_root
log_daemon_msg "Restarting wmii status bar filler" "i3status-wmii"
2009-06-21 12:51:32 +00:00
start-stop-daemon --stop --retry 5 --quiet --pidfile /var/run/i3status-wmii.pid --name i3status-wmii
start-stop-daemon --start --background --quiet --make-pidfile --pidfile /var/run/i3status-wmii.pid --name i3status-wmii --startas /usr/bin/i3status-wmii
;;
*) log_action_msg "Usage: $0 {start|stop|restart|reload|force-reload}"
exit 2
;;
esac
exit 0