#!/bin/bash USER=root GENTOASTER=/usr/share/gentoaster/daemon.php RETVAL=0 start() { echo "Starting Gentoaster" start-stop-daemon --quiet --start --background --chuid "$USER" --exec /usr/bin/php -- -f $GENTOASTER RETVAL=$? } stop() { echo "Stopping Gentoaster" killall -q -w -u $USER $GENTOASTER RETVAL=$? } case "$1" in start) start ;; stop) stop ;; restart) stop start ;; *) echo "Usage: gentoaster {start|stop|restart}" exit 1 ;; esac exit $RETVAL