diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index 4b07d537b..16973cfc1 100644 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -114,10 +114,14 @@ if [ -d "${backupdir}" ]; then if [ -z "${backupdirdu}" ]; then backupdirdu="0M" fi - # number of backups. - backupcount=$(find "${backupdir}"/*.tar.gz | wc -l) + + # number of backups set to 0 by default + backupcount=0 + # 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.