From f256e6dcdfe3a7c433de2d15cddbd75db328d07c Mon Sep 17 00:00:00 2001 From: Bennett-Wendorf Date: Sun, 9 Jan 2022 14:56:36 -0600 Subject: [PATCH] Added overwrite choice to backup script --- system_backup.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/system_backup.sh b/system_backup.sh index 151e279..3cd2be1 100755 --- a/system_backup.sh +++ b/system_backup.sh @@ -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/*