From 4070ed7ce6047b5fb4abfd66c5908eed0a5893e1 Mon Sep 17 00:00:00 2001 From: archandanime <36922812+archandanime@users.noreply.github.com> Date: Tue, 3 Oct 2023 23:18:48 +0700 Subject: [PATCH] Fix S11configbackup creates /wyze_config_backup without wyze_config_backup/configs --- SD_ROOT/wz_mini/etc/init.d/S11configbackup | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/SD_ROOT/wz_mini/etc/init.d/S11configbackup b/SD_ROOT/wz_mini/etc/init.d/S11configbackup index 2fc3270..900aeff 100644 --- a/SD_ROOT/wz_mini/etc/init.d/S11configbackup +++ b/SD_ROOT/wz_mini/etc/init.d/S11configbackup @@ -7,13 +7,16 @@ . /opt/wz_mini/wz_mini.conf -if df / | grep -q overlayfs; then - mount --bind /sdcard /opt # Temporarily let this script do its operations as if SD Card is mounted as /opt -fi case "$1" in start) 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 + fi if [ -d /opt/wyze_config_backup ]; then echo "Factory config backup directory exists" @@ -54,13 +57,14 @@ case "$1" in umount /params fi fi + + if df / | grep -q overlayfs; then + umount /opt/wyze_config_backup + fi ;; *) echo "Usage: $0 {start}" exit 1 ;; esac -if df / | grep -q overlayfs; then - umount /opt -fi