Fix S11configbackup doesn't generate BACKUP_THESE_FILES.md file

This commit is contained in:
archandanime 2023-10-03 23:59:38 +07:00 committed by GitHub
parent 323c071a6d
commit e327633e5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,17 +12,25 @@ case "$1" in
echo "#####$(basename "$0")#####" 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 df / | grep -q overlayfs; then
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 if [ -d /opt/wyze_config_backup ]; then
echo "Factory config backup directory exists" echo "Factory config backup directory exists"
else else
echo "Creating factory config backup directory" echo "Creating factory config backup directory"
mkdir /opt/wyze_config_backup mkdir /opt/wyze_config_backup
fi
fi
if ! [ -f /opt/wyze_config_backup/BACKUP_THESE_FILES.md ]; then
touch /opt/wyze_config_backup/BACKUP_THESE_FILES.md 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 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 fi
@ -59,7 +67,7 @@ case "$1" in
fi fi
if df / | grep -q overlayfs; then if df / | grep -q overlayfs; then
umount /opt/wyze_config_backup rm /opt/wyze_config_backup
fi fi
;; ;;
*) *)