58 lines
1.1 KiB
Bash
58 lines
1.1 KiB
Bash
#! /bin/sh
|
|
#
|
|
# /etc/init.d/LCDd lcdproc server starting and stopping
|
|
#
|
|
|
|
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
|
DAEMON=/usr/sbin/LCDd
|
|
NAME=LCDd
|
|
DESC="LCDproc 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/LCDd.conf"
|
|
fi
|
|
|
|
test -x $DAEMON || exit 0
|
|
|
|
set -e
|
|
|
|
case "$1" in
|
|
start)
|
|
echo -n "Starting $DESC: "
|
|
start-stop-daemon --start --quiet --background \
|
|
--exec $DAEMON -- $OPTIONS
|
|
echo "$NAME."
|
|
;;
|
|
stop)
|
|
echo -n "Stopping $DESC: "
|
|
start-stop-daemon --stop --oknodo --quiet \
|
|
--exec $DAEMON
|
|
echo "$NAME."
|
|
;;
|
|
restart|reload|force-reload)
|
|
$0 stop
|
|
sleep 1
|
|
$0 start
|
|
;;
|
|
*)
|
|
N=/etc/init.d/$NAME
|
|
# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
|
|
echo "Usage: $N {start|stop|restart|force-reload}" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
exit 0
|