diff options
author | Syam | 2015-06-24 07:46:30 +0530 |
---|---|---|
committer | Syam | 2015-06-24 07:46:30 +0530 |
commit | b52c787669149677979782a8c4cd638315233dd5 (patch) | |
tree | 9b5172e89380ce02aefdd95083db665ff4dbdc9c /incremental-complete-backup/backup-tool.sh | |
parent | 112aa8ea9ab5faf91b16eb3d7539f6beb0ab85a0 (diff) | |
download | FOSSEE-netbook-tools-master.tar.gz FOSSEE-netbook-tools-master.tar.bz2 FOSSEE-netbook-tools-master.zip |
confirmation dialog box before formating SDcard
Diffstat (limited to 'incremental-complete-backup/backup-tool.sh')
-rw-r--r-- | incremental-complete-backup/backup-tool.sh | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/incremental-complete-backup/backup-tool.sh b/incremental-complete-backup/backup-tool.sh index 880e92d..5ffe1dd 100644 --- a/incremental-complete-backup/backup-tool.sh +++ b/incremental-complete-backup/backup-tool.sh @@ -24,6 +24,21 @@ case "${choice}" in result="2" # if option2 is selected. ;; esac +} +confirm_format() { +zenity --question --text "SDcard will be formated. All the data on the Sdcard will be deleted. You may take a backup.\n\nDo you want to continue?" +if [ $? -eq 0 ] +then +echo $? +else +zenity --question --text "Are you sure to want to quit" +if [ $? -eq 0 ] +then +exit +else +confirm_format +fi +fi } # ------------------------------------------------------------# # sudoAccess() get the sudo password from user via zenity # @@ -167,7 +182,7 @@ dev_name="mmcblk0" # assuming SDcard only. selection_menu "Select Backup mode" "Incremental Backup_:_only copies files that have changed since last backup" "Complete Backup_:_creates a full copy which can be restored." case "${result}" in "1" ) # Incremental - selection_menu "Incremental Backup options" "Continue with previous backup storage[if you have a previous incremental backup] " "Create a new backup by formating the storage" + selection_menu "Incremental Backup options" "Continue with previous backup storage[if you have a previous incremental backup] " "Create a new incremental backup" case "${result}" in "1" ) # "Continue with previous backup": check for mac_id matching & proceed to rsync rootfs_path=`mount | grep ext|cut -d" " -f3` # tracking the rootfs mount path @@ -190,6 +205,7 @@ case "${result}" in fi ;; "2" ) # "new incremental backup" start new rsync + confirm_format cat /sys/class/net/eth0/address > /opt/.Hw_addr.txt # storing mac_id b4 copy formatforIncremental sudo rsync -lavtgrzpo --progress /opt/fossee-os/* /mnt/boot/| @@ -208,6 +224,7 @@ case "${result}" in esac ;; "2" ) # Complete + confirm_format formatforComplete sudo rsync -latgrzpo /opt/fossee-os/* /mnt/boot/ | zenity --progress --title "Preparing SDcard" \ |