diff options
Diffstat (limited to 'gentoaster')
-rwxr-xr-x | gentoaster | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/gentoaster b/gentoaster new file mode 100755 index 0000000..32d7d63 --- /dev/null +++ b/gentoaster @@ -0,0 +1,35 @@ +#!/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 + |