67 lines
1.3 KiB
Bash
67 lines
1.3 KiB
Bash
#! /bin/sh
|
|
|
|
#### BEGIN INIT INFO
|
|
# Provides: LCDd
|
|
# Required-Start: $syslog $local_fs $network $remote_fs
|
|
# Required-Stop: $syslog $local_fs $network $remote_fs
|
|
# Default-Start: 2 3 4 5
|
|
# Default-Stop: S 0 1 6
|
|
# Short-Description: LCDproc Server Daemon
|
|
# Description: Debian init script for LCDd, the display
|
|
# server daemon in the LCDproc suite
|
|
### END INIT INFO
|
|
|
|
|
|
# local variables
|
|
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
|
DAEMON=/usr/sbin/LCDd
|
|
NAME=LCDd
|
|
DESC="LCDproc display server daemon"
|
|
DEFAULTS=/etc/default/$NAME
|
|
|
|
# Source defaults file; edit that file to configure this script.
|
|
if [ -e "${DEFAULTS}" ]; then
|
|
. "${DEFAULTS}"
|
|
fi
|
|
|
|
# If we're not to start the daemon, simply exit
|
|
if [ "${START}" != "yes" ]; then
|
|
exit 0
|
|
fi
|
|
|
|
# if no OPTIONS are defined use default options
|
|
if [ -z "${OPTIONS}" ]; then
|
|
OPTIONS="-c /etc/lcdproc/LCDd.conf"
|
|
fi
|
|
|
|
# installation check
|
|
test -x $DAEMON || exit 5
|
|
|
|
# load LSB 3.x init functions
|
|
. /lib/lsb/init-functions
|
|
|
|
|
|
case "$1" in
|
|
start)
|
|
log_daemon_msg "Starting $DESC" "$NAME"
|
|
start_daemon $DAEMON $OPTIONS
|
|
log_end_msg $?
|
|
;;
|
|
stop)
|
|
log_daemon_msg "Stopping $DESC" "$NAME"
|
|
killproc $DAEMON
|
|
log_end_msg $?
|
|
;;
|
|
restart|reload|force-reload)
|
|
$0 stop
|
|
sleep 1
|
|
$0 start
|
|
;;
|
|
*)
|
|
echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload|force-reload}" >&2
|
|
exit 2
|
|
;;
|
|
esac
|
|
|
|
exit 0
|