#! /bin/sh # -*- coding: utf-8 -*- # start-stop-daemon -S -b -x /opt/bin/qpe -- -qws set -e DAEMON=/opt/Qtopia/bin/qpe.sh NAME=qpe DESC="qtopia server" test -x $DAEMON || exit 0 # Source defaults file; edit that file to configure this script. ENABLED=1 PARAMS="" if [ -e /etc/default/qtopia ]; then . /etc/default/qtopia fi test "$ENABLED" != "0" || exit 0 start_it_up() { if [ ! -d $PIDDIR ]; then mkdir -p $PIDDIR fi echo -n "Starting $DESC: " fbset.real -depth 24 mux & start-stop-daemon --start --background --quiet \ --exec $DAEMON -- --system $PARAMS echo "$NAME." } shut_it_down() { echo -n "Stopping $DESC: " if [ -e /tmp/restart-qtopia ]; then rm /tmp/restart-qtopia killall qpe 2> /dev/null fi echo "$NAME." } case "$1" in start) start_it_up ;; stop) shut_it_down ;; restart|force-reload) shut_it_down sleep 1 start_it_up ;; *) echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload}" >&2 exit 1 ;; esac exit 0