Compare commits

...

3 Commits

Author SHA1 Message Date
tteckster c10678e251
Update TurnKey scripts
Disable the 'exit on error' behavior while checking for an IP.
2023-09-10 17:05:03 -04:00
tteckster 3b1560fa63
An alternative method for acquiring the IP address in the TurnKey scripts. 2023-09-10 16:07:40 -04:00
tteckster c64c8d5adf
Update turnkey-gameserver.sh
remove test MAC
2023-09-10 15:57:03 -04:00
13 changed files with 40 additions and 14 deletions

View File

@ -164,11 +164,12 @@ pct start "$CTID"
sleep 5 sleep 5
# Get container IP # Get container IP
set +e
max_attempts=5 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
@ -183,6 +184,7 @@ if [[ -z $IP ]]; then
IP="NOT FOUND" IP="NOT FOUND"
fi fi
set -e
# Start Proxmox VE Monitor-All if available # Start Proxmox VE Monitor-All if available
if [[ -f /etc/systemd/system/ping-instances.service ]]; then if [[ -f /etc/systemd/system/ping-instances.service ]]; then
systemctl start ping-instances.service systemctl start ping-instances.service

View File

@ -164,11 +164,12 @@ pct start "$CTID"
sleep 5 sleep 5
# Get container IP # Get container IP
set +e
max_attempts=5 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
@ -183,6 +184,7 @@ if [[ -z $IP ]]; then
IP="NOT FOUND" IP="NOT FOUND"
fi fi
set -e
# Start Proxmox VE Monitor-All if available # Start Proxmox VE Monitor-All if available
if [[ -f /etc/systemd/system/ping-instances.service ]]; then if [[ -f /etc/systemd/system/ping-instances.service ]]; then
systemctl start ping-instances.service systemctl start ping-instances.service

View File

@ -18,7 +18,7 @@ PCT_OPTIONS="
-cores 2 -cores 2
-memory 2048 -memory 2048
-password $PASS -password $PASS
-net0 name=eth0,bridge=vmbr0,hwaddr=AE:1A:60:07:B7:59,ip=dhcp -net0 name=eth0,bridge=vmbr0,ip=dhcp
-unprivileged 1 -unprivileged 1
" "
DEFAULT_PCT_OPTIONS=( DEFAULT_PCT_OPTIONS=(
@ -164,11 +164,12 @@ pct start "$CTID"
sleep 5 sleep 5
# Get container IP # Get container IP
set +e
max_attempts=5 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
@ -183,6 +184,7 @@ if [[ -z $IP ]]; then
IP="NOT FOUND" IP="NOT FOUND"
fi fi
set -e
# Start Proxmox VE Monitor-All if available # Start Proxmox VE Monitor-All if available
if [[ -f /etc/systemd/system/ping-instances.service ]]; then if [[ -f /etc/systemd/system/ping-instances.service ]]; then
systemctl start ping-instances.service systemctl start ping-instances.service

View File

@ -164,11 +164,12 @@ pct start "$CTID"
sleep 5 sleep 5
# Get container IP # Get container IP
set +e
max_attempts=5 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
@ -183,6 +184,7 @@ if [[ -z $IP ]]; then
IP="NOT FOUND" IP="NOT FOUND"
fi fi
set -e
# Start Proxmox VE Monitor-All if available # Start Proxmox VE Monitor-All if available
if [[ -f /etc/systemd/system/ping-instances.service ]]; then if [[ -f /etc/systemd/system/ping-instances.service ]]; then
systemctl start ping-instances.service systemctl start ping-instances.service

View File

@ -164,11 +164,12 @@ pct start "$CTID"
sleep 5 sleep 5
# Get container IP # Get container IP
set +e
max_attempts=5 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
@ -183,6 +184,7 @@ if [[ -z $IP ]]; then
IP="NOT FOUND" IP="NOT FOUND"
fi fi
set -e
# Start Proxmox VE Monitor-All if available # Start Proxmox VE Monitor-All if available
if [[ -f /etc/systemd/system/ping-instances.service ]]; then if [[ -f /etc/systemd/system/ping-instances.service ]]; then
systemctl start ping-instances.service systemctl start ping-instances.service

View File

@ -164,11 +164,12 @@ pct start "$CTID"
sleep 5 sleep 5
# Get container IP # Get container IP
set +e
max_attempts=5 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
@ -183,6 +184,7 @@ if [[ -z $IP ]]; then
IP="NOT FOUND" IP="NOT FOUND"
fi fi
set -e
# Start Proxmox VE Monitor-All if available # Start Proxmox VE Monitor-All if available
if [[ -f /etc/systemd/system/ping-instances.service ]]; then if [[ -f /etc/systemd/system/ping-instances.service ]]; then
systemctl start ping-instances.service systemctl start ping-instances.service

View File

@ -164,11 +164,12 @@ pct start "$CTID"
sleep 5 sleep 5
# Get container IP # Get container IP
set +e
max_attempts=5 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
@ -183,6 +184,7 @@ if [[ -z $IP ]]; then
IP="NOT FOUND" IP="NOT FOUND"
fi fi
set -e
# Start Proxmox VE Monitor-All if available # Start Proxmox VE Monitor-All if available
if [[ -f /etc/systemd/system/ping-instances.service ]]; then if [[ -f /etc/systemd/system/ping-instances.service ]]; then
systemctl start ping-instances.service systemctl start ping-instances.service

View File

@ -164,11 +164,12 @@ pct start "$CTID"
sleep 5 sleep 5
# Get container IP # Get container IP
set +e
max_attempts=5 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
@ -183,6 +184,7 @@ if [[ -z $IP ]]; then
IP="NOT FOUND" IP="NOT FOUND"
fi fi
set -e
# Start Proxmox VE Monitor-All if available # Start Proxmox VE Monitor-All if available
if [[ -f /etc/systemd/system/ping-instances.service ]]; then if [[ -f /etc/systemd/system/ping-instances.service ]]; then
systemctl start ping-instances.service systemctl start ping-instances.service

View File

@ -164,11 +164,12 @@ pct start "$CTID"
sleep 5 sleep 5
# Get container IP # Get container IP
set +e
max_attempts=5 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
@ -183,6 +184,7 @@ if [[ -z $IP ]]; then
IP="NOT FOUND" IP="NOT FOUND"
fi fi
set -e
# Start Proxmox VE Monitor-All if available # Start Proxmox VE Monitor-All if available
if [[ -f /etc/systemd/system/ping-instances.service ]]; then if [[ -f /etc/systemd/system/ping-instances.service ]]; then
systemctl start ping-instances.service systemctl start ping-instances.service

View File

@ -164,11 +164,12 @@ pct start "$CTID"
sleep 5 sleep 5
# Get container IP # Get container IP
set +e
max_attempts=5 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
@ -183,6 +184,7 @@ if [[ -z $IP ]]; then
IP="NOT FOUND" IP="NOT FOUND"
fi fi
set -e
# Start Proxmox VE Monitor-All if available # Start Proxmox VE Monitor-All if available
if [[ -f /etc/systemd/system/ping-instances.service ]]; then if [[ -f /etc/systemd/system/ping-instances.service ]]; then
systemctl start ping-instances.service systemctl start ping-instances.service

View File

@ -164,11 +164,12 @@ pct start "$CTID"
sleep 5 sleep 5
# Get container IP # Get container IP
set +e
max_attempts=5 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
@ -183,6 +184,7 @@ if [[ -z $IP ]]; then
IP="NOT FOUND" IP="NOT FOUND"
fi fi
set -e
# Start Proxmox VE Monitor-All if available # Start Proxmox VE Monitor-All if available
if [[ -f /etc/systemd/system/ping-instances.service ]]; then if [[ -f /etc/systemd/system/ping-instances.service ]]; then
systemctl start ping-instances.service systemctl start ping-instances.service

View File

@ -164,11 +164,12 @@ pct start "$CTID"
sleep 5 sleep 5
# Get container IP # Get container IP
set +e
max_attempts=5 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
@ -183,6 +184,7 @@ if [[ -z $IP ]]; then
IP="NOT FOUND" IP="NOT FOUND"
fi fi
set -e
# Start Proxmox VE Monitor-All if available # Start Proxmox VE Monitor-All if available
if [[ -f /etc/systemd/system/ping-instances.service ]]; then if [[ -f /etc/systemd/system/ping-instances.service ]]; then
systemctl start ping-instances.service systemctl start ping-instances.service

View File

@ -164,11 +164,12 @@ pct start "$CTID"
sleep 5 sleep 5
# Get container IP # Get container IP
set +e
max_attempts=5 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
@ -183,6 +184,7 @@ if [[ -z $IP ]]; then
IP="NOT FOUND" IP="NOT FOUND"
fi fi
set -e
# Start Proxmox VE Monitor-All if available # Start Proxmox VE Monitor-All if available
if [[ -f /etc/systemd/system/ping-instances.service ]]; then if [[ -f /etc/systemd/system/ping-instances.service ]]; then
systemctl start ping-instances.service systemctl start ping-instances.service