Skip to content

Commit

Permalink
fix: deployments when no ipv4 or domain name provided (#3477)
Browse files Browse the repository at this point in the history
This fixes deployments when ipv4/domain name info is not provided in the
config.ini

With the switch to the new config format, when the ipv4 and domain name
variables are provided in the config.ini, the call to get_config_value
returns "null" where before it returned an empty string. The
conditionals have been updated to check for "null"
  • Loading branch information
andrewbattat authored Jan 16, 2025
1 parent 213bfee commit 233c1ee
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions ic-os/components/setupos-scripts/check-network.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,15 @@ function print_network_settings() {
echo "* Printing user defined network settings..."
echo " IPv6 Prefix : ${ipv6_prefix}"
echo " IPv6 Gateway: ${ipv6_gateway}"
if [[ -n ${ipv4_address} && -n ${ipv4_prefix_length} && -n ${ipv4_gateway} ]]; then
if [[ -n ${ipv4_address} && "${ipv4_address}" != "null" &&
-n ${ipv4_prefix_length} && "${ipv4_prefix_length}" != "null" &&
-n ${ipv4_gateway} && "${ipv4_gateway}" != "null" ]]; then
echo " IPv4 Address: ${ipv4_address}"
echo " IPv4 Prefix Length: ${ipv4_prefix_length}"
echo " IPv4 Gateway: ${ipv4_gateway}"
fi
if [[ -n ${domain_name} ]]; then
echo " Domain name : ${domain_name}"
if [[ -n ${domain_name} && "${domain_name}" != "null" ]]; then
echo " Domain name: ${domain_name}"
fi
echo " "

Expand Down Expand Up @@ -212,8 +214,13 @@ main() {
get_network_settings
print_network_settings

if [[ -n ${ipv4_address} && -n ${ipv4_prefix_length} && -n ${ipv4_gateway} ]]; then
if [[ -n ${domain_name} && "${domain_name}" != "null" ]]; then
validate_domain_name
fi

if [[ -n ${ipv4_address} && "${ipv4_address}" != "null" &&
-n ${ipv4_prefix_length} && "${ipv4_prefix_length}" != "null" &&
-n ${ipv4_gateway} && "${ipv4_gateway}" != "null" ]]; then
setup_ipv4_network
ping_ipv4_gateway
fi
Expand Down

0 comments on commit 233c1ee

Please sign in to comment.