#2938 improve detect old ssh data

This commit is contained in:
rootzoll 2022-02-07 19:53:08 +01:00
parent f5fe9968eb
commit 6bb8f11b2d

View file

@ -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)