Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #
- # lcd4linux
- #
- PLUGINDIR="/usr/lib/enigma2/python/Plugins/Extensions/LCD4linux"
- DAEMON="lcd4linux"
- NICELEVEL="19"
- LCDMAX=`cat /etc/enigma2/settings | grep LCD4linux.LCDMax=2`
- daemon_start() {
- if [ -f $PLUGINDIR/dpf$1.conf ]; then
- echo "Starting $DAEMON $1"
- start-stop-daemon --start --nicelevel $NICELEVEL --quiet --pidfile /var/run/lcd4linux$1.pid --exec $PLUGINDIR/$DAEMON -- -q -p /var/run/lcd4linux$1.pid -f $PLUGINDIR/dpf$1.conf
- else
- echo $PLUGINDIR/dpf$1.conf nicht gefunden
- fi
- }
- daemon_stop() {
- if [ -f /var/run/lcd4linux$1.pid ]; then
- echo "Stopping $DAEMON $1"
- start-stop-daemon --oknodo --stop --quiet --pidfile /var/run/lcd4linux$1.pid --exec $PLUGINDIR/$DAEMON
- sleep 2
- echo "LCD::backlight(0)" | $PLUGINDIR/$DAEMON -i -f $PLUGINDIR/dpf$1.conf
- fi
- }
- daemon_reload() {
- if [ -f /var/run/lcd4linux$1.pid ]; then
- start-stop-daemon --stop --signal 1 --quiet --pidfile /var/run/lcd4linux$1.pid --exec $PLUGINDIR/$DAEMON
- fi
- }
- case "$1" in
- start)
- daemon_start 1
- if [ $LCDMAX ]; then
- daemon_start 2
- fi
- ;;
- start1)
- daemon_start 1
- ;;
- start2)
- daemon_start 2
- ;;
- stop)
- daemon_stop 1
- if [ $LCDMAX ]; then
- daemon_stop 2
- fi
- ;;
- stop1)
- daemon_stop 1
- ;;
- stop2)
- daemon_stop 2
- ;;
- reload)
- daemon_reload 1
- if [ $LCDMAX ]; then
- daemon_reload 2
- fi
- ;;
- restart|force-reload)
- daemon_stop 1
- if [ $LCDMAX ]; then
- daemon_stop 2
- fi
- sleep 4
- daemon_start 1
- if [ $LCDMAX ]; then
- daemon_start 2
- fi
- ;;
- *)
- echo "Usage: $0 {start|stop|restart|reload|force-reload|start1|start2|stop1|stop2}" >&2
- exit 1
- ;;
- esac
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement