genconfig: Describe backup conf deletion
* Handle back-up configuration deletion better by informing the user why the back-up vanished and why. * Closes #33
This commit is contained in:
parent
96ffed0984
commit
8d8f19d951
@ -193,8 +193,14 @@ for i in "${OVPN_PUSH[@]}"; do
|
||||
echo push \"$i\" >> "$conf"
|
||||
done
|
||||
|
||||
# Clean-up duplicate configs (always return success)
|
||||
diff -q "$bak_env" "$OVPN_ENV" 2> /dev/null && rm "$bak_env" || true
|
||||
diff -q "$bak" "$conf" 2> /dev/null && rm "$bak" || true
|
||||
# Clean-up duplicate configs
|
||||
if diff -q "$bak_env" "$OVPN_ENV"; then
|
||||
echo "Removing duplicate back-up: $bak_env"
|
||||
rm -fv "$bak_env"
|
||||
fi
|
||||
if diff -q "$bak" "$conf"; then
|
||||
echo "Removing duplicate back-up: $bak"
|
||||
rm -fv "$bak"
|
||||
fi
|
||||
|
||||
echo "Successfully generated config"
|
||||
|
Loading…
Reference in New Issue
Block a user