From 844452a6236a3aaf78d97ca0111e29775988b882 Mon Sep 17 00:00:00 2001 From: SgtBatten Date: Sat, 9 Feb 2019 17:49:41 +1100 Subject: [PATCH] fix error fix error message if less than 5 backups exist --- update.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/update.sh b/update.sh index 2d52766..4a40ad0 100644 --- a/update.sh +++ b/update.sh @@ -397,5 +397,9 @@ if [ -n "${1}" ]; then fi ### Remove all but the 5 most recent backups ### -ls -dt "$DIR"/updatescript/*/ | tail -n +6 | xargs rm -r +if [ "$(ls -ld $DIR/updatescript/* | wc -l)" -gt 5 ] +then + ls -dt "$DIR"/updatescript/*/ | tail -n +6 | xargs rm -r + echo "Removed old backups from updatescript folder." +fi