aboutsummaryrefslogtreecommitdiff
blob: 32d7d637238a7c19b92e3c3d4c43111c77dee3cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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