From cf12032dd4e6077893c480b5330875a8d71a40ab Mon Sep 17 00:00:00 2001 From: sgk Date: Fri, 24 Apr 2015 12:50:15 +0530 Subject: Fix $device_name fix tracking $device_name --- incremental-complete-backup/backup-tool.sh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/incremental-complete-backup/backup-tool.sh b/incremental-complete-backup/backup-tool.sh index e86c5b2..70abeda 100644 --- a/incremental-complete-backup/backup-tool.sh +++ b/incremental-complete-backup/backup-tool.sh @@ -62,7 +62,7 @@ done removeSDCARD() { # The dialog box below will ask user to remove drive(sdcard) zenity --question --title "Remove media" \ ---text "Please remove your drive(sdcard) if connected, +--text "Please remove your drive (sdcard/pendrive) if connected, then press YES to continue" # Checking the return value of zenity dialog, same as previous function if [ $? -eq 1 ] @@ -82,7 +82,7 @@ fi # ------------------------------------------------------------# insertSDCARD() { # The dialog box below will ask user to insert sdcard -zenity --question --title "Insert media" --text "Now please insert your drive(sdcard) back,\ +zenity --question --title "Insert media" --text "Now please insert your drive(sdcard/pendrive) back,\ then press YES to continue" # Checking the button selected in zenity dialog if [ $? -eq 1 ] @@ -157,7 +157,16 @@ sudoAccess removeSDCARD insertSDCARD SizeofSDCARD -dev_name=`lsblk |head -2|tail -1|cut -d" " -f1` # tracking device name +if [ `ls /dev/mmc*` != "" ] ; +then # memory card detected + $dev_name=`ls /dev/mmc* |head -1` +elif [ `ls /dev/sd*` != "" ]; +then # pendrive detected + $dev_name=`ls /dev/sd* |head -1` +else + zenity --width=600 --height=100 --info --text "Device not found !" + exit +fi selection_menu "Select Backup mode" "Incremental Backup" "Complete Backup" case "${result}" in "1" ) # Incremental @@ -193,6 +202,9 @@ case "${result}" in "2" ) # Complete formatforComplete sudo rsync -latgrzpo /opt/fossee-os/* /mnt/boot/ + rm -r ~/.ssh ~/.mozilla ~/.config/chromium + rm -r ~/Templates ~/Downloads/* + rm ~/.vimrc ~/.viminfo rm -f /etc/udev/rules.d/70-persistent-net.rules sudo tar -cpzf /mnt/boot/fossee-os.tar.gz --one-file-system / sync -- cgit