From 6bb8f11b2d53396ee85dd9e46cf0c47185777965 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 7 Feb 2022 19:53:08 +0100 Subject: [PATCH] #2938 improve detect old ssh data --- home.admin/config.scripts/blitz.datadrive.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/home.admin/config.scripts/blitz.datadrive.sh b/home.admin/config.scripts/blitz.datadrive.sh index d4fb33033..d5b5cdf2e 100755 --- a/home.admin/config.scripts/blitz.datadrive.sh +++ b/home.admin/config.scripts/blitz.datadrive.sh @@ -241,7 +241,8 @@ if [ "$1" = "status" ]; then cp -a /mnt/hdd${subVolumeDir}/app-data/wpa_supplicant.conf /var/cache/raspiblitz/hdd-inspect/wpa_supplicant.conf 2>/dev/null # Convert old ssh backup data structure (if needed) - if [ -d "/mnt/hdd/ssh" ]; then + oldDataExists=$(sudo ls /mnt/hdd/ssh/ssh_host_rsa_key 2>/dev/null | grep -c "ssh_host_rsa_key") + if [ "${oldDataExists}" != "0" ]; then # make a complete backup of directory cp -a /mnt/hdd/ssh /mnt/hdd/app-storage/ssh-old-backup # delete old false sub directory (if exists)