NetVM: strip all wg-quick-only keys for wg setconf
This commit is contained in:
@@ -54,7 +54,7 @@ if ! nsexec ip link show "$WG" >/dev/null 2>&1; then
|
||||
ip link set "$WG" netns "$NETNS"
|
||||
fi
|
||||
STRIPPED=$(mktemp)
|
||||
grep -vE '^\s*(Address|DNS)\s*=' "$CONF" > "$STRIPPED"
|
||||
grep -vE '^\s*(Address|DNS|MTU|Table|PreUp|PreDown|PostUp|PostDown|SaveConfig)\s*' "$CONF" > "$STRIPPED"
|
||||
nsexec wg setconf "$WG" "$STRIPPED"
|
||||
rm -f "$STRIPPED"
|
||||
MTU=$(grep -oP '^\s*MTU\s*=\s*\K\d+' "$CONF" | head -1); MTU=${MTU:-1280}
|
||||
|
||||
Reference in New Issue
Block a user