diff --git a/SD_ROOT/wz_mini/etc/init.d/S11configbackup b/SD_ROOT/wz_mini/etc/init.d/S11configbackup index 900aeff..d05f7aa 100644 --- a/SD_ROOT/wz_mini/etc/init.d/S11configbackup +++ b/SD_ROOT/wz_mini/etc/init.d/S11configbackup @@ -12,17 +12,25 @@ case "$1" in echo "#####$(basename "$0")#####" + if df / | grep -q overlayfs; then - mkdir -p /sdcard/wyze_config_backup - mkdir -p /opt/wyze_config_backup - mount --bind /sdcard/wyze_config_backup /opt/wyze_config_backup + if [ -d /sdcard/wyze_config_backup ]; then + echo "Factory config backup directory exists" + else + echo "Creating factory config backup directory" + mkdir /sdcard/wyze_config_backup + fi + ln -s /sdcard/wyze_config_backup /opt/wyze_config_backup + else + if [ -d /opt/wyze_config_backup ]; then + echo "Factory config backup directory exists" + else + echo "Creating factory config backup directory" + mkdir /opt/wyze_config_backup + fi fi - if [ -d /opt/wyze_config_backup ]; then - echo "Factory config backup directory exists" - else - echo "Creating factory config backup directory" - mkdir /opt/wyze_config_backup + if ! [ -f /opt/wyze_config_backup/BACKUP_THESE_FILES.md ]; then touch /opt/wyze_config_backup/BACKUP_THESE_FILES.md echo "These files are the cloud credentials unique to your camera. Back them up in case your camera's flash becomes corrupted. The camera will NEVER connect to the cloud if they are wiped from the camera." > /opt/wyze_config_backup/BACKUP_THESE_FILES.md fi @@ -59,7 +67,7 @@ case "$1" in fi if df / | grep -q overlayfs; then - umount /opt/wyze_config_backup + rm /opt/wyze_config_backup fi ;; *)