Don't create interface if it already exists (#1487)

This is now needed because `set -e` was added to the calling script.
Before, we simply allowed the command to fail silently.

Fixes #1485
This commit is contained in:
Jamil
2023-03-03 08:40:04 -08:00
committed by GitHub
parent d451e72037
commit 7b081dd503

View File

@@ -11,6 +11,10 @@
setup_interface()
{
if [ ! -d "/sys/class/net/${WIREGUARD_INTERFACE_NAME}" ]; then
ip link add ${WIREGUARD_INTERFACE_NAME} type wireguard
fi
ip link add ${WIREGUARD_INTERFACE_NAME} type wireguard
if [ "$WIREGUARD_IPV4_ENABLED" = "true" ]; then