From e6d26168bfaa27b6f1347f33f390e099159eccd4 Mon Sep 17 00:00:00 2001 From: Daniel Hansson Date: Fri, 4 Mar 2022 22:10:32 +0100 Subject: [PATCH] only check if the file actually is there (#2253) --- nextcloud_update.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nextcloud_update.sh b/nextcloud_update.sh index af05b8dd..c0166b8f 100644 --- a/nextcloud_update.sh +++ b/nextcloud_update.sh @@ -195,10 +195,13 @@ then fi else # Only update if it's older than 60 days (60 seconds * 60 minutes * 24 hours * 60 days) - if [ "$(stat --format=%Y "$SCRIPTS"/nextcloud.sh)" -le "$(( $(date +%s) - ((60*60*24*60)) ))" ] + if [ -f "$SCRIPTS"/nextcloud.sh ] then - download_script STATIC nextcloud - chown "$CURRUSR":"$CURRUSR" "$SCRIPTS"/nextcloud.sh + if [ "$(stat --format=%Y "$SCRIPTS"/nextcloud.sh)" -le "$(( $(date +%s) - ((60*60*24*60)) ))" ] + then + download_script STATIC nextcloud + chown "$CURRUSR":"$CURRUSR" "$SCRIPTS"/nextcloud.sh + fi fi fi