mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 07:28:39 +01:00
mwan3: add "use" function to mwan3 utils
Use "mwan3 use" to wrap a command with interface bindings so that you can avoid the mwan3 rules and test behavior on a specific interface. eg "mwan3 use wan ping -c1 1.1.1.1" Additional binding arguments to the command will have their system calls intercepted and ignored. eg "mwan3 use wan ping -c1 -I tun0 1.1.1.1" will use the device associated with "wan", rather than "tun0". Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
This commit is contained in:
@@ -129,7 +129,7 @@ firstconnect() {
|
||||
return
|
||||
fi
|
||||
|
||||
mwan3_get_src_ip SRC_IP $true_iface
|
||||
mwan3_get_src_ip SRC_IP $INTERFACE
|
||||
|
||||
LOG debug "firstconnect: called on $INTERFACE/$true_iface ($DEVICE). Status is $STATUS. SRC_IP is $SRC_IP"
|
||||
|
||||
@@ -223,7 +223,7 @@ main() {
|
||||
wait $TRACK_PID
|
||||
result=$?
|
||||
else
|
||||
WRAP $PING -${family#ipv} -I ${SOURCE} -c $count -W $timeout -s $size -t $max_ttl -q $track_ip 2>/dev/null > $TRACK_OUTPUT &
|
||||
WRAP $PING -${family#ipv} -c $count -W $timeout -s $size -t $max_ttl -q $track_ip 2>/dev/null > $TRACK_OUTPUT &
|
||||
TRACK_PID=$!
|
||||
wait $TRACK_PID
|
||||
ping_status=$?
|
||||
|
||||
Reference in New Issue
Block a user