aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsquashfu5
1 files changed, 3 insertions, 2 deletions
diff --git a/squashfu b/squashfu
index 6f0653f..05274ec 100755
--- a/squashfu
+++ b/squashfu
@@ -289,7 +289,7 @@ action_remove_bin () {
if [[ $(grep -E "^$1:" ${BINVENTORY}) && -d "${BINS_DIR}/$1" ]]; then
if [[ -z $2 ]]; then
echo "Are you SURE you want to remove this bin?"
- local timestamp=$(sed -n "/$1/s/^[0-9]*://" "${BINVENTORY}")
+ local timestamp=$(sed -n "/^$1/s/^[0-9]*://" "${BINVENTORY}")
printf "\t%15s %s\n\t%15s %s\n\t%15s %s\n" \
"Bin:" "$1" \
"Date Created:" "$(date --rfc-3339=seconds --date="1970-01-01 $timestamp sec GMT")" \
@@ -352,11 +352,12 @@ action_report () {
echo
# Enumerate bins, sort date order, print human readable create date and size
+ cd "$BINS_DIR"
OLDIFS=$IFS;IFS=${IFS}:
# Collect all data into an array to 'preload' it. Index 0 is the entire
# folder. The following indicies correspond to the bin number of that index
printf "%30s\r" " .: Loading :." >&2
- DATA=($(du -sh ${BINS_DIR} ${BINS_DIR}/* 2>/dev/null | awk '{print $1}'))
+ DATA=($(du -sh . * 2>/dev/null | sort -n -k2 | awk '{print $1}'))
printf "%30s\r" " " >&2
printf "%10s\t%25s\t%7s\n" "Bin ID" "Date Created" "Size"