summaryrefslogtreecommitdiff
path: root/recipes/havp/files/havp.init
blob: 245a28e7bcee462b7d108613c68685a20528b282 (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/havp
HAVP_CONFIG=/etc/havp/havp.config
PIDFILE=/var/run/havp/havp.pid
NAME="havp"
DESC="HAVP"

test -r /etc/default/havp && . /etc/default/havp
test -x "$DAEMON" || exit 0
test ! -r "$HAVP_CONFIG" && exit 0
        
case "$1" in
  start)
    echo "Starting $DESC: "
    start-stop-daemon --oknodo -S -x $DAEMON -- -c $HAVP_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