Skip to content

Commit 683a467

Browse files
committed
fix: #239 ip address selection
1 parent d82db3d commit 683a467

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: scripts/self-hosted/install-server.sh

+7-1
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,12 @@ choose_ip_address() {
144144
header "$prompt"
145145
echo "$help_text"
146146

147+
if [ ${#ip_array[@]} -eq 0 ]; then
148+
echo "$(red "No IP addresses found.")"
149+
echo "$(red "Please check your network configuration.")"
150+
exit 1
151+
fi
152+
147153
if [ ${#ip_array[@]} -eq 1 ]; then
148154
local chosen_ip="${ip_array[0]}"
149155
echo -e "$(green "Only one IP address available:") $(cyan "$chosen_ip")\n"
@@ -214,7 +220,7 @@ get_user_credentials() {
214220
echo -e "\n$(green "Credentials saved successfully.")"
215221
}
216222

217-
IP_LIST=$(/tmp/ptah-agent list-ips)
223+
IP_LIST="$(/tmp/ptah-agent list-ips | tr -d '\n')"
218224
choose_ip_address "$IP_LIST" "Advertised IP addresses" "ADVERTISE_ADDR" "$ADVERTISED_IP_HELP"
219225
choose_ip_address "$IP_LIST" "Public IP address" "PUBLIC_IP" "$PUBLIC_IP_HELP"
220226

0 commit comments

Comments
 (0)