Added overwrite choice to backup script

This commit is contained in:
Bennett-Wendorf 2022-01-09 14:56:36 -06:00
parent 633ab5b8c6
commit f256e6dcdf

View File

@ -1,6 +1,15 @@
#!/bin/bash
if [ ! -d "./.system_backup" ]; then
sudo mkdir ./.system_backup
else
echo "It looks like a backup of your previous configuration already exists. Would you like to delete that backup and create a new one of the current configuration? [Y]es or [N]o."
read override_choice
if [ "${override_choice^^}" = "N" ]; then
echo "Not overwriting existing backup and cancelling backup process!"
exit
else
echo "Overwriting existing backup to create a new one now."
fi
fi
sudo rm -rf ./.system_backup/*