mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-18 19:00:15 +00:00
fix(ufw): Fix ufw insert error
fix ufw error when inserting rules with an empty chain
This commit is contained in:
parent
955f268db2
commit
8603013fc3
1 changed files with 15 additions and 11 deletions
|
@ -3178,11 +3178,14 @@ confNetwork() {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Insert rules at the beginning of the chain
|
# Checks for any existing UFW rules and
|
||||||
|
# insert rules at the beginning of the chain
|
||||||
# (in case there are other rules that may drop the traffic)
|
# (in case there are other rules that may drop the traffic)
|
||||||
|
if ${SUDO} ufw status numbered | grep -E "\[.[0-9]{1}\]" > /dev/null; then
|
||||||
${SUDO} ufw insert 1 \
|
${SUDO} ufw insert 1 \
|
||||||
allow "${pivpnPORT}/${pivpnPROTO}" \
|
allow "${pivpnPORT}/${pivpnPROTO}" \
|
||||||
comment "allow-${VPN}" > /dev/null
|
comment "allow-${VPN}" > /dev/null
|
||||||
|
|
||||||
${SUDO} ufw route insert 1 \
|
${SUDO} ufw route insert 1 \
|
||||||
allow in on "${pivpnDEV}" \
|
allow in on "${pivpnDEV}" \
|
||||||
from "${pivpnNET}/${subnetClass}" \
|
from "${pivpnNET}/${subnetClass}" \
|
||||||
|
@ -3194,6 +3197,7 @@ confNetwork() {
|
||||||
from "${pivpnNETv6}/${subnetClassv6}" \
|
from "${pivpnNETv6}/${subnetClassv6}" \
|
||||||
out on "${IPv6dev}" to any > /dev/null
|
out on "${IPv6dev}" to any > /dev/null
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
${SUDO} ufw reload > /dev/null
|
${SUDO} ufw reload > /dev/null
|
||||||
echo "::: UFW configuration completed."
|
echo "::: UFW configuration completed."
|
||||||
|
|
Loading…
Reference in a new issue