diff --git a/turnkey/turnkey-core.sh b/turnkey/turnkey-core.sh index f780971e..49ff3b73 100644 --- a/turnkey/turnkey-core.sh +++ b/turnkey/turnkey-core.sh @@ -168,7 +168,7 @@ max_attempts=5 attempt=1 IP="" while [[ $attempt -le $max_attempts ]]; do - IP=$(pct exec $CTID ip route get 8.8.8.8 | sed -n '/src/{s/.*src *\([^ ]*\).*/\1/p;q}') + IP=$(pct exec $CTID ip a show dev eth0 | grep -oP 'inet \K[^/]+') if [[ -n $IP ]]; then break else diff --git a/turnkey/turnkey-fileserver.sh b/turnkey/turnkey-fileserver.sh index 01915039..379e8785 100644 --- a/turnkey/turnkey-fileserver.sh +++ b/turnkey/turnkey-fileserver.sh @@ -168,7 +168,7 @@ max_attempts=5 attempt=1 IP="" while [[ $attempt -le $max_attempts ]]; do - IP=$(pct exec $CTID ip route get 8.8.8.8 | sed -n '/src/{s/.*src *\([^ ]*\).*/\1/p;q}') + IP=$(pct exec $CTID ip a show dev eth0 | grep -oP 'inet \K[^/]+') if [[ -n $IP ]]; then break else diff --git a/turnkey/turnkey-gameserver.sh b/turnkey/turnkey-gameserver.sh index e810688a..9bf18305 100644 --- a/turnkey/turnkey-gameserver.sh +++ b/turnkey/turnkey-gameserver.sh @@ -168,7 +168,7 @@ max_attempts=5 attempt=1 IP="" while [[ $attempt -le $max_attempts ]]; do - IP=$(pct exec $CTID ip route get 8.8.8.8 | sed -n '/src/{s/.*src *\([^ ]*\).*/\1/p;q}') + IP=$(pct exec $CTID ip a show dev eth0 | grep -oP 'inet \K[^/]+') if [[ -n $IP ]]; then break else diff --git a/turnkey/turnkey-gitea.sh b/turnkey/turnkey-gitea.sh index 4f122c0d..2573f471 100644 --- a/turnkey/turnkey-gitea.sh +++ b/turnkey/turnkey-gitea.sh @@ -168,7 +168,7 @@ max_attempts=5 attempt=1 IP="" while [[ $attempt -le $max_attempts ]]; do - IP=$(pct exec $CTID ip route get 8.8.8.8 | sed -n '/src/{s/.*src *\([^ ]*\).*/\1/p;q}') + IP=$(pct exec $CTID ip a show dev eth0 | grep -oP 'inet \K[^/]+') if [[ -n $IP ]]; then break else diff --git a/turnkey/turnkey-gitlab.sh b/turnkey/turnkey-gitlab.sh index 0a59fad6..b5ec6f5f 100644 --- a/turnkey/turnkey-gitlab.sh +++ b/turnkey/turnkey-gitlab.sh @@ -168,7 +168,7 @@ max_attempts=5 attempt=1 IP="" while [[ $attempt -le $max_attempts ]]; do - IP=$(pct exec $CTID ip route get 8.8.8.8 | sed -n '/src/{s/.*src *\([^ ]*\).*/\1/p;q}') + IP=$(pct exec $CTID ip a show dev eth0 | grep -oP 'inet \K[^/]+') if [[ -n $IP ]]; then break else diff --git a/turnkey/turnkey-mediaserver.sh b/turnkey/turnkey-mediaserver.sh index a4a6a538..f43e54a1 100644 --- a/turnkey/turnkey-mediaserver.sh +++ b/turnkey/turnkey-mediaserver.sh @@ -168,7 +168,7 @@ max_attempts=5 attempt=1 IP="" while [[ $attempt -le $max_attempts ]]; do - IP=$(pct exec $CTID ip route get 8.8.8.8 | sed -n '/src/{s/.*src *\([^ ]*\).*/\1/p;q}') + IP=$(pct exec $CTID ip a show dev eth0 | grep -oP 'inet \K[^/]+') if [[ -n $IP ]]; then break else diff --git a/turnkey/turnkey-nextcloud.sh b/turnkey/turnkey-nextcloud.sh index 02383f51..2147c3c2 100644 --- a/turnkey/turnkey-nextcloud.sh +++ b/turnkey/turnkey-nextcloud.sh @@ -168,7 +168,7 @@ max_attempts=5 attempt=1 IP="" while [[ $attempt -le $max_attempts ]]; do - IP=$(pct exec $CTID ip route get 8.8.8.8 | sed -n '/src/{s/.*src *\([^ ]*\).*/\1/p;q}') + IP=$(pct exec $CTID ip a show dev eth0 | grep -oP 'inet \K[^/]+') if [[ -n $IP ]]; then break else diff --git a/turnkey/turnkey-observium.sh b/turnkey/turnkey-observium.sh index b065d90e..d4e5e5de 100644 --- a/turnkey/turnkey-observium.sh +++ b/turnkey/turnkey-observium.sh @@ -168,7 +168,7 @@ max_attempts=5 attempt=1 IP="" while [[ $attempt -le $max_attempts ]]; do - IP=$(pct exec $CTID ip route get 8.8.8.8 | sed -n '/src/{s/.*src *\([^ ]*\).*/\1/p;q}') + IP=$(pct exec $CTID ip a show dev eth0 | grep -oP 'inet \K[^/]+') if [[ -n $IP ]]; then break else diff --git a/turnkey/turnkey-openvpn.sh b/turnkey/turnkey-openvpn.sh index 62483753..4727d459 100644 --- a/turnkey/turnkey-openvpn.sh +++ b/turnkey/turnkey-openvpn.sh @@ -168,7 +168,7 @@ max_attempts=5 attempt=1 IP="" while [[ $attempt -le $max_attempts ]]; do - IP=$(pct exec $CTID ip route get 8.8.8.8 | sed -n '/src/{s/.*src *\([^ ]*\).*/\1/p;q}') + IP=$(pct exec $CTID ip a show dev eth0 | grep -oP 'inet \K[^/]+') if [[ -n $IP ]]; then break else diff --git a/turnkey/turnkey-owncloud.sh b/turnkey/turnkey-owncloud.sh index c726005a..0ae77f2d 100644 --- a/turnkey/turnkey-owncloud.sh +++ b/turnkey/turnkey-owncloud.sh @@ -168,7 +168,7 @@ max_attempts=5 attempt=1 IP="" while [[ $attempt -le $max_attempts ]]; do - IP=$(pct exec $CTID ip route get 8.8.8.8 | sed -n '/src/{s/.*src *\([^ ]*\).*/\1/p;q}') + IP=$(pct exec $CTID ip a show dev eth0 | grep -oP 'inet \K[^/]+') if [[ -n $IP ]]; then break else diff --git a/turnkey/turnkey-torrentserver.sh b/turnkey/turnkey-torrentserver.sh index b6638157..6d15b34c 100644 --- a/turnkey/turnkey-torrentserver.sh +++ b/turnkey/turnkey-torrentserver.sh @@ -168,7 +168,7 @@ max_attempts=5 attempt=1 IP="" while [[ $attempt -le $max_attempts ]]; do - IP=$(pct exec $CTID ip route get 8.8.8.8 | sed -n '/src/{s/.*src *\([^ ]*\).*/\1/p;q}') + IP=$(pct exec $CTID ip a show dev eth0 | grep -oP 'inet \K[^/]+') if [[ -n $IP ]]; then break else diff --git a/turnkey/turnkey-wordpress.sh b/turnkey/turnkey-wordpress.sh index 56400e73..3ae34dea 100644 --- a/turnkey/turnkey-wordpress.sh +++ b/turnkey/turnkey-wordpress.sh @@ -168,7 +168,7 @@ max_attempts=5 attempt=1 IP="" while [[ $attempt -le $max_attempts ]]; do - IP=$(pct exec $CTID ip route get 8.8.8.8 | sed -n '/src/{s/.*src *\([^ ]*\).*/\1/p;q}') + IP=$(pct exec $CTID ip a show dev eth0 | grep -oP 'inet \K[^/]+') if [[ -n $IP ]]; then break else diff --git a/turnkey/turnkey-zoneminder.sh b/turnkey/turnkey-zoneminder.sh index daf137b7..be3197c3 100644 --- a/turnkey/turnkey-zoneminder.sh +++ b/turnkey/turnkey-zoneminder.sh @@ -168,7 +168,7 @@ max_attempts=5 attempt=1 IP="" while [[ $attempt -le $max_attempts ]]; do - IP=$(pct exec $CTID ip route get 8.8.8.8 | sed -n '/src/{s/.*src *\([^ ]*\).*/\1/p;q}') + IP=$(pct exec $CTID ip a show dev eth0 | grep -oP 'inet \K[^/]+') if [[ -n $IP ]]; then break else