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
This commit is contained in:
Kyle Manna 2015-03-09 09:17:42 -07:00
parent 8d8f19d951
commit 88c76c787e

View File

@ -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