mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 15:38:40 +01:00
mwan3: reduce dependency on src_ip
Interfaces may be managed by 3rd-party scripts, thus src_ip may not be always available in uci. Signed-off-by: David Yang <mmyangfl@gmail.com>
This commit is contained in:
@@ -34,6 +34,10 @@ validate_track_method() {
|
||||
$LOG warn "Missing httping. Please install httping package."
|
||||
return 1
|
||||
}
|
||||
[ -n "$2" -a "$2" != "0.0.0.0" -a "$2" != "::" ] || {
|
||||
$LOG warn "Cannot determine source IP for the interface which is required by httping."
|
||||
return 1
|
||||
}
|
||||
;;
|
||||
*)
|
||||
$LOG warn "Unsupported tracking method: $track_method"
|
||||
@@ -59,7 +63,7 @@ main() {
|
||||
|
||||
config_load mwan3
|
||||
config_get track_method $1 track_method ping
|
||||
validate_track_method $track_method || {
|
||||
validate_track_method $track_method $SRC_IP || {
|
||||
$LOG warn "Using ping to track interface $INTERFACE avaliability"
|
||||
track_method=ping
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user