From 8a92727fb1b625faa0d5e150291c6aa3bae57f70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sat, 7 Sep 2019 13:01:45 +0200 Subject: [PATCH] Check that exist before the calculate the checksum --- data/helpers.d/backup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/helpers.d/backup b/data/helpers.d/backup index dcf306085..d3ffffcd3 100644 --- a/data/helpers.d/backup +++ b/data/helpers.d/backup @@ -339,7 +339,7 @@ ynh_backup_if_checksum_is_different () { backup_file_checksum="" if [ -n "$checksum_value" ] then # Proceed only if a value was stored into the app settings - if ! echo "$checksum_value $file" | sudo md5sum -c --status + if [ -e $file ] && ! echo "$checksum_value $file" | sudo md5sum -c --status then # If the checksum is now different backup_file_checksum="/home/yunohost.conf/backup/$file.backup.$(date '+%Y%m%d.%H%M%S')" sudo mkdir -p "$(dirname "$backup_file_checksum")"