From 4e10aff51d4b56f4d467dcd9f726bdb9d60677ca Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Mon, 18 Jan 2010 21:32:56 -0500 Subject: Round1 of bug fixes --- squashfu | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/squashfu b/squashfu index e18c6a7..690fc23 100755 --- a/squashfu +++ b/squashfu @@ -270,7 +270,7 @@ action_backup () { action_remove_bin () { # check if the bin exists both in the binventory AND in the bins directory - if [[ $UID -eq 0 ]]; then + if [[ $UID -ne 0 ]]; then die "Must be root to remove a backup" fi @@ -278,15 +278,16 @@ action_remove_bin () { die "Error writing to ${BINVENTORY}" fi - if [[ -z $2 && grep -E "^$1:" && -d "${BINS_DIR}/$1" ]]; then + if [[ -z $2 && $(grep -E "^$1:" ${BINVENTORY}) && -d "${BINS_DIR}/$1" ]]; then echo "Are you SURE you want to remove this bin?" - printf "Bin ID: %s\nDate Created: %s\nSize: %s\n" \ + printf "\tBin ID: %s\n\tDate Created: %s\n\tSize: %s\n" \ "$1" \ "$(date --rfc-3339=seconds --date="1970-01-01 $rb_timestamp sec GMT")" \ "$(du -sh "${BINS_DIR}/$1" 2>/dev/null)" read -p "Confirm deletion (y/N)" confirm if [[ $confirm != "y" ]]; then + info "Delete operation aborted" exit 1 fi fi -- cgit v1.2.3