Browse Source

mwan3: add check for ping

Signed-off-by: David Yang <mmyangfl@gmail.com>
lilik-openwrt-22.03
David Yang 7 years ago
parent
commit
474e6bbdd7
1 changed files with 10 additions and 2 deletions
  1. +10
    -2
      net/mwan3/files/usr/sbin/mwan3track

+ 10
- 2
net/mwan3/files/usr/sbin/mwan3track View File

@ -21,7 +21,10 @@ if_down() {
validate_track_method() {
case "$1" in
ping)
# Assume that ping is installed
which ping 1>/dev/null 2>&1 || {
$LOG warn "Missing ping. Please install iputils-ping package or enable ping util and recompile busybox."
return 1
}
;;
arping)
which arping 1>/dev/null 2>&1 || {
@ -64,8 +67,13 @@ main() {
config_load mwan3
config_get track_method $1 track_method ping
validate_track_method $track_method $SRC_IP || {
$LOG warn "Using ping to track interface $INTERFACE avaliability"
track_method=ping
if validate_track_method $track_method; then
$LOG warn "Using ping to track interface $INTERFACE avaliability"
else
$LOG err "No track method avaliable"
exit 1
fi
}
config_get reliability $1 reliability 1
config_get count $1 count 1


Loading…
Cancel
Save