Fixed missing condition in if statement when deciding whether to listen on tun0/wg0

This commit is contained in:
Orazio 2020-02-15 13:24:42 +01:00
parent 660d83468c
commit edbd23a2a1

View file

@ -1445,10 +1445,16 @@ askClientDNS(){
# Then create an empty hosts file or clear if it exists.
$SUDO bash -c "> /etc/pivpn/hosts.$VPN"
# If the listening behavior is "Listen only on interface whatever", tell dnsmasq
# to listen on the VPN interface as well. Other listening behaviors are permissive
# enough.
if [ "$(source "$piholeSetupVars" && echo "${DNSMASQ_LISTENING}")" = "single" ]; then
# If the listening behavior is "Listen only on interface whatever", which is the
# default, tell dnsmasq to listen on the VPN interface as well. Other listening
# behaviors are permissive enough.
# Source in a subshell to prevent overwriting script's variables
DNSMASQ_LISTENING="$(source "$piholeSetupVars" && echo "${DNSMASQ_LISTENING}")"
# $DNSMASQ_LISTENING is not set if you never edit/save settings in the DNS page,
# so if the variable is empty, we still add the 'interface=' directive.
if [ -z "${DNSMASQ_LISTENING}" ] || [ "${DNSMASQ_LISTENING}" = "single" ]; then
echo "interface=$pivpnDEV" | $SUDO tee -a "$dnsmasqConfig" > /dev/null
fi