Jaap Marcus vor 2 Jahren
Ursprung
Commit
7491d3c005
3 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen
  1. 1 1
      bin/v-update-sys-ip
  2. 1 1
      install/hst-install-debian.sh
  3. 2 2
      src/deb/nginx/hestia

+ 1 - 1
bin/v-update-sys-ip

@@ -46,7 +46,7 @@ if [ -z "$physical_nics" ]; then
 fi
 
 for nic in $physical_nics; do
-	nic_ipv4s="$(ip -4 -d -j addr show "$nic" | jq -r '.[] | select(length > 0) | .addr_info[] | if .scope == "global" then .local else empty end');"
+	nic_ipv4s="$(ip -4 -d -j addr show "$nic" | jq -r '.[] | select(length > 0) | .addr_info[] | if .scope == "global" then .local else empty end')"
 	if [ -z "$ips" ]; then
 		ips="$nic_ipv4s"
 	else

+ 1 - 1
install/hst-install-debian.sh

@@ -2076,7 +2076,7 @@ $HESTIA/bin/v-update-sys-ip > /dev/null 2>&1
 # Get primary IP
 default_nic="$(ip -d -j route show | jq -r '.[] | if .dst == "default" then .dev else empty end')"
 # IPv4
-primary_ipv4="$(ip -4 -d -j addr show "$default_nic" | jq -r '.[].addr_info[] | if .scope == "global" then .local else empty end' | head -n1)"
+primary_ipv4="$(ip -4 -d -j addr show "$default_nic" | jq -r '.[] | select(length > 0) | .addr_info[] | if .scope == "global" then .local else empty end' | head -n1)"
 # IPv6
 #primary_ipv6="$(ip -6 -d -j addr show "$default_nic" | jq -r '.[].addr_info[] | if .scope == "global" then .local else empty end' | head -n1)"
 ip="$primary_ipv4"

+ 2 - 2
src/deb/nginx/hestia

@@ -39,10 +39,10 @@ adapt_nginx_config() {
 	fi
 	for nic in $physical_nics; do
 		if [ -z "$ipv4_scope_global" ]; then
-			ipv4_scope_global="$(ip -4 -d -j addr show "$nic" | jq -r '.[] | select(length > 0) | .addr_info[] | if .scope == "global" then .local else empty end');"
+			ipv4_scope_global="$(ip -4 -d -j addr show "$nic" | jq -r '.[] | select(length > 0) | .addr_info[] | if .scope == "global" then .local else empty end')"
 		fi
 		if [ -z "$ipv6_scope_global" ]; then
-			ipv6_scope_global="$(ip -6 -d -j addr show "$nic" | jq -r '.[] | select(length > 0) | .addr_info[] | if .scope == "global" then .local else empty end');"
+			ipv6_scope_global="$(ip -6 -d -j addr show "$nic" | jq -r '.[] | select(length > 0) | .addr_info[] | if .scope == "global" then .local else empty end')"
 		fi
 	done