1
1
mirror of https://github.com/angristan/wireguard-install.git synced 2024-11-29 00:06:31 +00:00

Allow a default IPv6 NIC

Missed to commit in the refactor PR
This commit is contained in:
randomshell 2020-08-22 20:26:21 +00:00
parent 7d4c11d507
commit a193f5ad78

View File

@ -80,6 +80,9 @@ function installQuestions() {
# Detect public interface and pre-fill for the user
SERVER_NIC=${SERVER_NIC:-$(ip -4 route ls | grep default | grep -Po '(?<=dev )(\S+)' | head -1)}
if [[ -z $SERVER_NIC ]]; then
SERVER_NIC=$(ip -6 route show default | sed -ne 's/^default .* dev \([^ ]*\) .*$/\1/p')
fi
APPROVE_NIC=${APPROVE_NIC:-n}
until [[ ${SERVER_PUB_NIC} =~ ^[a-zA-Z0-9_]+$ || ${APPROVE_NIC} =~ n ]]; do
read -rp "Public interface: " -e -i "${SERVER_NIC}" SERVER_PUB_NIC