mirror of
https://github.com/angristan/wireguard-install.git
synced 2024-06-05 21:10:48 +00:00
Merge 61b7d2a085
into 39caf2fcf6
This commit is contained in:
commit
d33eb3dfd6
|
@ -110,10 +110,10 @@ function installQuestions() {
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Detect public IPv4 or IPv6 address and pre-fill for the user
|
# Detect public IPv4 or IPv6 address and pre-fill for the user
|
||||||
SERVER_PUB_IP=$(ip -4 addr | sed -ne 's|^.* inet \([^/]*\)/.* scope global.*$|\1|p' | awk '{print $1}' | head -1)
|
SERVER_PUB_IP=$(curl -4 https://ifconfig.co)
|
||||||
if [[ -z ${SERVER_PUB_IP} ]]; then
|
if [[ -z ${SERVER_PUB_IP} ]]; then
|
||||||
# Detect public IPv6 address
|
# Detect public IPv6 address
|
||||||
SERVER_PUB_IP=$(ip -6 addr | sed -ne 's|^.* inet6 \([^/]*\)/.* scope global.*$|\1|p' | head -1)
|
SERVER_PUB_IP=$(curl -6 https://ifconfig.co)
|
||||||
fi
|
fi
|
||||||
read -rp "IPv4 or IPv6 public address: " -e -i "${SERVER_PUB_IP}" SERVER_PUB_IP
|
read -rp "IPv4 or IPv6 public address: " -e -i "${SERVER_PUB_IP}" SERVER_PUB_IP
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user