minor fix
authorIan Kelling <ian@iankelling.org>
Mon, 1 May 2023 02:29:20 +0000 (22:29 -0400)
committerIan Kelling <ian@iankelling.org>
Mon, 1 May 2023 02:29:20 +0000 (22:29 -0400)
system-status

index cd603ca57e4f982e149107d2aef856ccffb46451..7d5567d8d16bda261d5672140e7d3e87980dba03 100755 (executable)
@@ -140,13 +140,13 @@ write-status() {
     # PS4='+ $(date "+%2N") '
     # allow failure in case there are no snapshots yet.
     # shellcheck disable=SC2012
-    shopt -u nullglob
-    files=($btrbk_root/$vol.20*)
     shopt -s nullglob
-    snaps=()
-    if (( ${#files[@]} )); then
-      snaps=($(ls -1avdr "${files[@]}" 2>/dev/null |head -n1 || : ))
+    files=($btrbk_root/$vol.20*)
+    shopt -u nullglob
+    if (( ! ${#files[@]} )); then
+      continue
     fi
+    snaps=($(ls -1avdr "${files[@]}" 2>/dev/null |head -n1 || : ))
     now=$EPOCHSECONDS
     maxtime=0
     for s in ${snaps[@]}; do