mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
inteno-netmodes: netmode-discover: fping wan network only if mask is 24 or less
This commit is contained in:
parent
0e5beb085a
commit
d08ce1dfdb
2 changed files with 5 additions and 2 deletions
|
|
@ -401,6 +401,7 @@ start_netmode_tools() {
|
|||
config_get_bool repeaterready setup repeaterready 0
|
||||
|
||||
[ $repeaterready -eq 1 ] && {
|
||||
/sbin/netmode-discover &
|
||||
/sbin/wificontrol --repeater &
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue