diff --git a/setup/start.sh b/setup/start.sh index 6cda9561..301adead 100755 --- a/setup/start.sh +++ b/setup/start.sh @@ -24,6 +24,11 @@ fi # Gather information from the user about the hostname and public IP # address of this host. if [ -z "$PUBLIC_HOSTNAME" ]; then + if [ -z "$DEFAULT_PUBLIC_HOSTNAME" ]; then + # set a default on first run + DEFAULT_PUBLIC_HOSTNAME=`get_default_hostname` + fi + echo echo "Enter the hostname you want to assign to this machine." echo "We've guessed a value. Just backspace it if it's wrong." @@ -31,39 +36,34 @@ if [ -z "$PUBLIC_HOSTNAME" ]; then echo "be similar." echo - if [ -z "$DEFAULT_PUBLIC_HOSTNAME" ]; then - # set a default on first run - DEFAULT_PUBLIC_HOSTNAME=`get_default_hostname` - fi - read -e -i "$DEFAULT_PUBLIC_HOSTNAME" -p "Hostname: " PUBLIC_HOSTNAME fi if [ -z "$PUBLIC_IP" ]; then + if [ -z "$DEFAULT_PUBLIC_IP" ]; then + # set a default on first run + DEFAULT_PUBLIC_IP=`get_default_publicip` + fi + echo echo "Enter the public IP address of this machine, as given to" echo "you by your ISP. We've guessed a value, but just backspace" echo "it if it's wrong." echo - if [ -z "$DEFAULT_PUBLIC_IP" ]; then - # set a default on first run - DEFAULT_PUBLIC_IP=`get_default_publicip` - fi - read -e -i "$DEFAULT_PUBLIC_IP" -p "Public IP: " PUBLIC_IP fi if [ -z "$PUBLIC_IPV6" ]; then - echo - echo "(Optional) Enter the IPv6 address of this machine. Leave blank" - echo " if the machine does not have an IPv6 address." - - if [ -z "$DEFAULT_PUBLIC_IPV6" ]; then + if [ -z "$DEFAULT_PUBLIC_IPV6" ]; then # set a default on first run DEFAULT_PUBLIC_IPV6=`get_default_publicipv6` fi + echo + echo "(Optional) Enter the IPv6 address of this machine. Leave blank" + echo " if the machine does not have an IPv6 address." + read -e -i "$DEFAULT_PUBLIC_IPV6" -p "Public IPv6: " PUBLIC_IPV6 fi