summaryrefslogtreecommitdiff
path: root/examples/var_service/supplicant_if/run
blob: 5c813b07f296b80aabea9a20de53e9e5a8644c5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/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