blob: 58472bab1559d86ce158d4f890cd2b0a7aafe79e [file] [log] [blame]
Stewart Smithb2bcc832015-08-20 13:38:33 +10001#!/bin/sh
2
3LOGFILE=/var/log/petitboot/pb-discover.log
4PIDFILE=/var/run/petitboot.pid
5
6PATH=/usr/bin:/usr/sbin:/bin:/sbin
7export PATH
8
9verbose=
10if pb-config debug | grep -q enabled
11then
12 verbose=-v
13fi
14
15case "$1" in
16 start)
17 ulimit -c unlimited
18 mkdir -p $(dirname $LOGFILE)
19 pb-discover -l $LOGFILE $verbose &
20 echo $! > $PIDFILE
21 ;;
22 stop)
23 pid=$(cat $PIDFILE)
24 [ -n "$pid" ] && kill -TERM $pid
25 ;;
26 *)
27 echo "Usage: $0 {start|stop}"
28 exit 1
29 ;;
30esac
31
32exit 0