ipsec-interfaces: Don't add any interfaces when IPsec is disabled

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
Michael Tremer
2018-12-10 16:57:12 +00:00
parent a56357b8be
commit 1a45f9a70a

View File

@@ -37,15 +37,14 @@ log() {
}
main() {
# We are done when IPsec is not enabled
[ "${ENABLED}" = "on" ] || exit 0
# Register local variables
local "${VARS[@]}"
local action
local interfaces=()
# We are done when IPsec is not enabled
if [ "${ENABLED}" = "on" ]; then
while IFS="," read -r "${VARS[@]}"; do
# Check if the connection is enabled
[ "${status}" = "on" ] || continue
@@ -98,6 +97,7 @@ main() {
# Bring up the interface
ip link set dev "${intf}" up
done < "${VPN_CONFIG}"
fi
# Delete all other interfaces
local intf