blob: 8f9638c6d2158829802c9e6ccfbadf75a6760395 [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)
Jeremy Kerrd7af67c2015-09-24 15:02:03 +100019 export $(cat /etc/locale)
Stewart Smithb2bcc832015-08-20 13:38:33 +100020 pb-discover -l $LOGFILE $verbose &
21 echo $! > $PIDFILE
22 ;;
23 stop)
24 pid=$(cat $PIDFILE)
25 [ -n "$pid" ] && kill -TERM $pid
26 ;;
27 *)
28 echo "Usage: $0 {start|stop}"
29 exit 1
30 ;;
31esac
32
33exit 0