mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2026-03-14 21:10:11 +01:00
27 lines
530 B
Bash
27 lines
530 B
Bash
#!/bin/sh
|
|
|
|
. /lib/functions.sh
|
|
. /lib/functions/netmode.sh
|
|
|
|
ps | grep hotplug | grep button && exit
|
|
|
|
[ -z "$INTERFACE" ] && exit
|
|
|
|
defroute=$(ip route | grep default | awk '{print$3}')
|
|
|
|
case "$(uci get netmode.setup.curmode)" in
|
|
repeater*)
|
|
;;
|
|
*)
|
|
ping -c 1 -w 5 $defroute >/dev/null 2>&1 || {
|
|
logger -s -t "80-repeater" "ping to $defroute failed, sending USR1 to udhcpc" >/dev/console
|
|
killall -USR1 udhcpc
|
|
}
|
|
exit
|
|
;;
|
|
esac
|
|
|
|
case "$ACTION" in
|
|
add|register|remove|unregister) correct_uplink $INTERFACE;;
|
|
esac
|
|
|