Quellcode durchsuchen

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
Daniel Gibbs vor 10 Jahren
Ursprung
Commit
1a5fc1471b
1 geänderte Dateien mit 3 neuen und 3 gelöschten Zeilen
  1. 3 3
      lgsm/functions/info_distro.sh

+ 3 - 3
lgsm/functions/info_distro.sh

@@ -108,16 +108,16 @@ fi
 
 
 ## Backup info
 ## Backup info
 if [ -d "${backupdir}" ]; then
 if [ -d "${backupdir}" ]; then
-	# Ued space in backups dir.
+	# Used space in backups dir.
 	backupdirdu=$(du -sh "${backupdir}" | awk '{print $1}')
 	backupdirdu=$(du -sh "${backupdir}" | awk '{print $1}')
 	# If no backup dir, size is 0M
 	# If no backup dir, size is 0M
 	if [ -z "${backupdirdu}" ]; then
 	if [ -z "${backupdirdu}" ]; then
 		backupdirdu="0M"
 		backupdirdu="0M"
 	fi
 	fi
+	# number of backups.
+	backupcount=$(find "${backupdir}"/*.tar.gz | wc -l)
 	# If there are backups in backup dir.
 	# If there are backups in backup dir.
 	if [ $(find "${backupdir}" -name "*.tar.gz" | wc -l) -ne "0" ]; then
 	if [ $(find "${backupdir}" -name "*.tar.gz" | wc -l) -ne "0" ]; then
-		# number of backups.
-		backupcount=$(find "${backupdir}"/*.tar.gz | wc -l)
 		# most recent backup.
 		# most recent backup.
 		lastbackup=$(ls -t "${backupdir}"/*.tar.gz | head -1)
 		lastbackup=$(ls -t "${backupdir}"/*.tar.gz | head -1)
 		# date of most recent backup.
 		# date of most recent backup.