Denys Vlasenko | d8330ca | 2016-09-20 18:09:00 +0200 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | exec 2>&1 |
| 4 | exec </dev/null |
| 5 | |
| 6 | pwd="$PWD" |
| 7 | |
| 8 | if="${PWD##*/dhcp_}" |
| 9 | |
| 10 | echo "* Upping iface $if" |
Denys Vlasenko | e17e8d4 | 2019-02-02 19:06:19 +0100 | [diff] [blame] | 11 | # "or sleep" idiom prevents rapid respawning if iface does not exist |
| 12 | ip link set dev "$if" up || { sleep 5; exit; } |
Denys Vlasenko | d8330ca | 2016-09-20 18:09:00 +0200 | [diff] [blame] | 13 | |
| 14 | ##echo "* Powersave disable on $if" |
| 15 | ##iw dev "$if" set power_save off |
| 16 | |
| 17 | echo "* Starting wpa_supplicant" |
| 18 | exec \ |
| 19 | env - PATH="$PATH" \ |
| 20 | softlimit \ |
| 21 | setuidgid root \ |
| 22 | wpa_supplicant -i "$if" -c "$pwd/wpa_supplicant.conf" -d |