An alternative method for acquiring the IP address in the TurnKey scripts.
This commit is contained in:
parent
c64c8d5adf
commit
3b1560fa63
13 changed files with 13 additions and 13 deletions
|
@ -168,7 +168,7 @@ max_attempts=5
|
||||||
attempt=1
|
attempt=1
|
||||||
IP=""
|
IP=""
|
||||||
while [[ $attempt -le $max_attempts ]]; do
|
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
|
if [[ -n $IP ]]; then
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
|
|
|
@ -168,7 +168,7 @@ max_attempts=5
|
||||||
attempt=1
|
attempt=1
|
||||||
IP=""
|
IP=""
|
||||||
while [[ $attempt -le $max_attempts ]]; do
|
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
|
if [[ -n $IP ]]; then
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
|
|
|
@ -168,7 +168,7 @@ max_attempts=5
|
||||||
attempt=1
|
attempt=1
|
||||||
IP=""
|
IP=""
|
||||||
while [[ $attempt -le $max_attempts ]]; do
|
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
|
if [[ -n $IP ]]; then
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
|
|
|
@ -168,7 +168,7 @@ max_attempts=5
|
||||||
attempt=1
|
attempt=1
|
||||||
IP=""
|
IP=""
|
||||||
while [[ $attempt -le $max_attempts ]]; do
|
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
|
if [[ -n $IP ]]; then
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
|
|
|
@ -168,7 +168,7 @@ max_attempts=5
|
||||||
attempt=1
|
attempt=1
|
||||||
IP=""
|
IP=""
|
||||||
while [[ $attempt -le $max_attempts ]]; do
|
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
|
if [[ -n $IP ]]; then
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
|
|
|
@ -168,7 +168,7 @@ max_attempts=5
|
||||||
attempt=1
|
attempt=1
|
||||||
IP=""
|
IP=""
|
||||||
while [[ $attempt -le $max_attempts ]]; do
|
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
|
if [[ -n $IP ]]; then
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
|
|
|
@ -168,7 +168,7 @@ max_attempts=5
|
||||||
attempt=1
|
attempt=1
|
||||||
IP=""
|
IP=""
|
||||||
while [[ $attempt -le $max_attempts ]]; do
|
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
|
if [[ -n $IP ]]; then
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
|
|
|
@ -168,7 +168,7 @@ max_attempts=5
|
||||||
attempt=1
|
attempt=1
|
||||||
IP=""
|
IP=""
|
||||||
while [[ $attempt -le $max_attempts ]]; do
|
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
|
if [[ -n $IP ]]; then
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
|
|
|
@ -168,7 +168,7 @@ max_attempts=5
|
||||||
attempt=1
|
attempt=1
|
||||||
IP=""
|
IP=""
|
||||||
while [[ $attempt -le $max_attempts ]]; do
|
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
|
if [[ -n $IP ]]; then
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
|
|
|
@ -168,7 +168,7 @@ max_attempts=5
|
||||||
attempt=1
|
attempt=1
|
||||||
IP=""
|
IP=""
|
||||||
while [[ $attempt -le $max_attempts ]]; do
|
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
|
if [[ -n $IP ]]; then
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
|
|
|
@ -168,7 +168,7 @@ max_attempts=5
|
||||||
attempt=1
|
attempt=1
|
||||||
IP=""
|
IP=""
|
||||||
while [[ $attempt -le $max_attempts ]]; do
|
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
|
if [[ -n $IP ]]; then
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
|
|
|
@ -168,7 +168,7 @@ max_attempts=5
|
||||||
attempt=1
|
attempt=1
|
||||||
IP=""
|
IP=""
|
||||||
while [[ $attempt -le $max_attempts ]]; do
|
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
|
if [[ -n $IP ]]; then
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
|
|
|
@ -168,7 +168,7 @@ max_attempts=5
|
||||||
attempt=1
|
attempt=1
|
||||||
IP=""
|
IP=""
|
||||||
while [[ $attempt -le $max_attempts ]]; do
|
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
|
if [[ -n $IP ]]; then
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue