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:
@@ -49,10 +49,12 @@ mwan3_get_true_iface()
|
||||
|
||||
mwan3_get_src_ip()
|
||||
{
|
||||
local family _src_ip true_iface device addr_cmd default_ip IP sed_str
|
||||
true_iface=$2
|
||||
local family _src_ip interface true_iface device addr_cmd default_ip IP sed_str
|
||||
interface=$2
|
||||
mwan3_get_true_iface true_iface $interface
|
||||
|
||||
unset "$1"
|
||||
config_get family "$true_iface" family ipv4
|
||||
config_get family "$interface" family ipv4
|
||||
if [ "$family" = "ipv4" ]; then
|
||||
addr_cmd='network_get_ipaddr'
|
||||
default_ip="0.0.0.0"
|
||||
|
||||
Reference in New Issue
Block a user