create_ap: Check if stdbuf is available

Some embedded systems use Busybox which does not provide stdbuf: this
patch then avoids to use coreutils package which is much larger in size.
This commit is contained in:
Alexandre Ghiti
2017-11-08 14:52:40 +01:00
parent 1645986f91
commit 63916eb393

View File

@ -1833,8 +1833,12 @@ if [[ $NO_HAVEGED -eq 0 ]]; then
HAVEGED_WATCHDOG_PID=$!
fi
# start hostapd (use stdbuf for no delayed output in programs that redirect stdout)
stdbuf -oL $HOSTAPD $HOSTAPD_DEBUG_ARGS $CONFDIR/hostapd.conf &
# start hostapd (use stdbuf when available for no delayed output in programs that redirect stdout)
STDBUF_PATH=`which stdbuf`
if [ $? -eq 0 ]; then
STDBUF_PATH=$STDBUF_PATH" -oL"
fi
$STDBUF_PATH $HOSTAPD $HOSTAPD_DEBUG_ARGS $CONFDIR/hostapd.conf &
HOSTAPD_PID=$!
echo $HOSTAPD_PID > $CONFDIR/hostapd.pid