From e6ce5fd38612b0f06e61945bceac6132b084b96e Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 28 Feb 2018 19:46:28 +0100 Subject: [PATCH] wg-quick: if resolvconf/run/iface exists, use it Some older broken resolvconfs don't support resolvconf -l, but do have a file in a standard location, so use it. Signed-off-by: Jason A. Donenfeld --- src/wg-quick.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wg-quick.bash b/src/wg-quick.bash index e93fb80..27bd4c7 100755 --- a/src/wg-quick.bash +++ b/src/wg-quick.bash @@ -203,7 +203,7 @@ save_config() { done while read -r address; do [[ $address =~ ^nameserver\ ([a-zA-Z0-9_=+:%.-]+)$ ]] && new_config+="DNS = ${BASH_REMATCH[1]}"$'\n' - done < <(resolvconf -l "$(resolvconf_iface_prefix)$INTERFACE" 2>/dev/null) + done < <(resolvconf -l "$(resolvconf_iface_prefix)$INTERFACE" 2>/dev/null || cat "/etc/resolvconf/run/interface/$(resolvconf_iface_prefix)$INTERFACE") [[ -n $MTU && $(ip link show dev "$INTERFACE") =~ mtu\ ([0-9]+) ]] && new_config+="MTU = ${BASH_REMATCH[1]}"$'\n' [[ -n $TABLE ]] && new_config+="Table = $TABLE"$'\n' [[ $SAVE_CONFIG -eq 0 ]] || new_config+=$'SaveConfig = true\n'