summaryrefslogtreecommitdiff
path: root/recipes/p3scan/files/p3scan.init
blob: 9f3865b8b234268153005954ca1f6318b63503ae (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
#!/bin/sh
DAEMON=/usr/sbin/p3scan
P3SCAN_CONFIG=/etc/p3scan/p3scan.conf
PIDFILE=/var/run/p3scan/p3scan.pid
NAME="p3scan"
DESC="P3SCAN"

test -r /etc/default/p3scan && . /etc/default/p3scan
test -x "$DAEMON" || exit 0
test ! -r "$P3SCAN_CONFIG" && exit 0
        
case "$1" in
  start)
    echo "Starting $DESC: "
    start-stop-daemon --oknodo -S -x $DAEMON -- -c $P3SCAN_CONFIG
    echo "$NAME."
    ;;

  stop)
    echo "Stopping $DESC:"
    start-stop-daemon -K -p $PIDFILE
    ;;

  restart)
    $0 stop >/dev/null 2>&1
    $0 start
    ;;

  *)
    echo "Usage: $0 {start|stop|restart}"
    exit 0
    ;;
esac