summaryrefslogtreecommitdiffstats
path: root/openpower/package/petitboot/S15pb-discover
blob: 8f9638c6d2158829802c9e6ccfbadf75a6760395 (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

LOGFILE=/var/log/petitboot/pb-discover.log
PIDFILE=/var/run/petitboot.pid

PATH=/usr/bin:/usr/sbin:/bin:/sbin
export PATH

verbose=
if pb-config debug | grep -q enabled
then
	verbose=-v
fi

case "$1" in
    start)
        ulimit -c unlimited
        mkdir -p $(dirname $LOGFILE)
        export $(cat /etc/locale)
        pb-discover -l $LOGFILE $verbose &
        echo $! > $PIDFILE
        ;;
    stop)
        pid=$(cat $PIDFILE)
        [ -n "$pid" ] && kill -TERM $pid
        ;;
    *)
        echo "Usage: $0 {start|stop}"
        exit 1
        ;;
esac

exit 0
OpenPOWER on IntegriCloud