From 88c76c787edc8fd1d8ac479980270d453066fd78 Mon Sep 17 00:00:00 2001 From: Kyle Manna Date: Mon, 9 Mar 2015 09:17:42 -0700 Subject: [PATCH] genconfig: Turn off exit on error at end * Need to check return status of diff, but don't want a false return code to exit the script. * Fixes #35 --- bin/ovpn_genconfig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/ovpn_genconfig b/bin/ovpn_genconfig index a4a829e..7e0b579 100755 --- a/bin/ovpn_genconfig +++ b/bin/ovpn_genconfig @@ -193,12 +193,14 @@ for i in "${OVPN_PUSH[@]}"; do echo push \"$i\" >> "$conf" done +set +e + # Clean-up duplicate configs -if diff -q "$bak_env" "$OVPN_ENV"; then +if diff -q "$bak_env" "$OVPN_ENV" 2>/dev/null; then echo "Removing duplicate back-up: $bak_env" rm -fv "$bak_env" fi -if diff -q "$bak" "$conf"; then +if diff -q "$bak" "$conf" 2>/dev/null; then echo "Removing duplicate back-up: $bak" rm -fv "$bak" fi