From acd75a2e6b31cb209449fc7454c0298c6b72613d Mon Sep 17 00:00:00 2001 From: Dmitri Popov Date: Mon, 8 Jan 2018 19:00:34 +0100 Subject: [PATCH] Add else to handle existing .id file :monkey: --- backup.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backup.sh b/backup.sh index 0a7a038..1559bdb 100755 --- a/backup.sh +++ b/backup.sh @@ -56,6 +56,9 @@ if [ ! -z $CARD_READER ]; then if [ ! -f $CARD_MOUNT_POINT/*.id ]; then ID=$RANDOM touch $ID."id" + else + ID_FILE=$(ls *.id) + ID="${ID_FILE%.*}" fi # Set the backup path