Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: add interface support #6

Closed
Magnetic2014 opened this issue Sep 9, 2022 · 1 comment · Fixed by #36
Closed

Feature request: add interface support #6

Magnetic2014 opened this issue Sep 9, 2022 · 1 comment · Fixed by #36

Comments

@Magnetic2014
Copy link

Magnetic2014 commented Sep 9, 2022

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.

@mzivic7
Copy link

mzivic7 commented Jun 7, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants