inteno-netmodes: netmode-discover: fping wan network only if mask is 24 or less

This commit is contained in:
Sukru Senli 2018-02-17 16:07:05 +01:00
parent 0e5beb085a
commit d08ce1dfdb
2 changed files with 5 additions and 2 deletions

View file

@ -401,6 +401,7 @@ start_netmode_tools() {
config_get_bool repeaterready setup repeaterready 0
[ $repeaterready -eq 1 ] && {
/sbin/netmode-discover &
/sbin/wificontrol --repeater &
return
}

View file

@ -21,6 +21,8 @@ mask_to_cidr() {
}
while true; do
[ -e /sys/class/net/br-wan ] || continue
unlisted=0
ps | grep -q wifi | grep -q reload || {
@ -33,10 +35,10 @@ while true; do
mask=$(mask_to_cidr $netmask)
}
if [ $unlisted -gt 0 -a -n "$ipaddr" -a -n "$netmask" ]; then
if [ $unlisted -gt 0 -a -n "$ipaddr" -a -n "$netmask" -a $mask -le 24 ]; then
fping -c 1 -t 1000 -g $ipaddr/$mask -q >/dev/null 2>&1
fi
sleep 20
sleep 30
done