-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add support for adding more clients #58
Conversation
This commit puts the client creation logic into a function. By running the script followed by `add_client`, the user will be asked a few questions and a new peer will be added. Removing client is **not** supported. The client files have random names. Fix for #3
|
if [[ $SERVER_PUB_IP =~ .*:.* ]] | ||
then | ||
echo "IPv6 Detected" | ||
ENDPOINT="[$SERVER_PUB_IP]:$SERVER_PORT" | ||
else | ||
echo "IPv4 Detected" | ||
ENDPOINT="$SERVER_PUB_IP:$SERVER_PORT" | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@angristan why do we need parenthesis?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because that's how you regex match in a bash if...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If anything changes how the variables are used to anchor them. For example ${SERVER_PUB_IP} etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry @AndreiG6, I meant why we need [ ]
for IPv6. Line 10
If it's for escaping the :
char we can use ${SERVER_PUB_IP}
instead of an if
case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not escaping anything, just poor concat/formating I suppose. Somewhere there's probably a split for "ipv4/6:port" format. As in whatever uses that $ENDPOINT var
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit puts the client creation logic into a function.
By running the script followed by
add_client
, the user will be asked a few questions and a new peer will be added.Removing client is not supported.
The client files have random names.
Fix for #3