Move public IP address detection out of bash

This commit is contained in:
Michael Vines
2018-06-29 16:49:23 -07:00
committed by Grimes
parent a31889f129
commit 450f271cf7
6 changed files with 52 additions and 30 deletions

View File

@ -10,9 +10,9 @@ if [[ -z "$mode" ]]; then
exit 0
fi
ip_address_arg=-p # Use public IP address (TODO: make this configurable?)
num_tokens="$(snapctl get num-tokens)"
public_ip="$(snapctl get public-ip)"
$SNAP/bin/setup.sh ${num_tokens:+-n $num_tokens} ${public_ip:+-p $public_ip}
$SNAP/bin/setup.sh ${num_tokens:+-n $num_tokens} ${ip_address_arg}
case $mode in
leader+drone)