Feature request: add interface support
Magnetic2014 opened this issue · 1 comments
Thanks so much for your powerful tool! Currently I can only start dispatch with IP address. Is there any plan to support interface name?
For example, I want to start dispatch with dispatch start en0 en1
. This is because the local IP address used in our company keeps changing every time I connect. Since I have no permission to set the static IP address, I have to check the current IP address before starting dispatch. I know I can obtain the address manually or with extra script but it would be much better (also more natural) to integrate this feature into your program.
Here is simple bash script for Linux, until this feature is implemented.
It supports 2 interfaces, but can be easily extended.
Script must be placed in same directory as dispatch binary, or modify last command to full path to file.
#!/bin/bash
if [ $# -eq 0 ]
then
echo Usage: dispatch_interfaces.sh address1 address2
else
addr1=$(ip -4 addr show $1 | grep -oP '(?<=inet\s)\d+(\.\d+){3}')
addr2=$(ip -4 addr show $2 | grep -oP '(?<=inet\s)\d+(\.\d+){3}')
./dispatch start $addr1 $addr2
fi