busybox/examples/var_service/supplicant_if/run
Denys Vlasenko 1e9a4f56f5 examples/var_service: use "exec sleep 5" instead of "{ sleep 5; exit; }"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-04-21 14:30:19 +02:00

23 lines
439 B
Bash
Executable File

#!/bin/sh
exec 2>&1
exec </dev/null
pwd="$PWD"
if="${PWD##*/dhcp_}"
echo "* Upping iface $if"
# "or sleep" idiom prevents rapid respawning if iface does not exist
ip link set dev "$if" up || exec sleep 5
##echo "* Powersave disable on $if"
##iw dev "$if" set power_save off
echo "* Starting wpa_supplicant on $if [$$]"
exec \
env - PATH="$PATH" \
softlimit \
setuidgid root \
wpa_supplicant -i "$if" -c "$pwd/wpa_supplicant.conf" -d