its-ap-builder/files/tl-wr841-v10/etc/hotplug.d/iface/10-disable-wifi-when-uplink-gone

21 lines
518 B
Text
Raw Normal View History

2017-10-04 18:52:03 +02:00
#!/bin/sh
logger -t wifi-uplink hotplug "$DEVICE" "$INTERFACE" "$ACTION"
# 'lan' doesn't work for some reason
[ "$INTERFACE" = apctl ] || exit 0
logger -t wifi-uplink devchange "$DEVICE" "$INTERFACE" "$ACTION"
[ "$ACTION" = ifup ] && {
logger -t wifi-uplink up "$DEVICE" "$INTERFACE" "$ACTION"
uci set wireless.@wifi-device[0].disabled=0
wifi
}
[ "$ACTION" = ifdown ] && {
logger -t wifi-uplink down "$DEVICE" "$INTERFACE" "$ACTION"
wifi down
uci set wireless.@wifi-device[0].disabled=1
}