From 1a5fc1471b95e551301aa6064e525c3c842dd672 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 31 Oct 2016 22:13:37 +0000 Subject: [PATCH] Fixes bug allowing backups to show when there are no backups Backups were being displayed in details even if the backups dir did not contain backups --- lgsm/functions/info_distro.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index cc4037d72..4b07d537b 100644 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -108,16 +108,16 @@ fi ## Backup info if [ -d "${backupdir}" ]; then - # Ued space in backups dir. + # Used space in backups dir. backupdirdu=$(du -sh "${backupdir}" | awk '{print $1}') # If no backup dir, size is 0M if [ -z "${backupdirdu}" ]; then backupdirdu="0M" fi + # number of backups. + backupcount=$(find "${backupdir}"/*.tar.gz | wc -l) # If there are backups in backup dir. if [ $(find "${backupdir}" -name "*.tar.gz" | wc -l) -ne "0" ]; then - # number of backups. - backupcount=$(find "${backupdir}"/*.tar.gz | wc -l) # most recent backup. lastbackup=$(ls -t "${backupdir}"/*.tar.gz | head -1) # date of most recent backup.