fix upgrade mode and script execution in rc.local.d

This commit is contained in:
Alfonso Gamboa
2022-07-15 11:36:01 -07:00
parent f7dcb77d01
commit c6f6674e4b
4 changed files with 19 additions and 8 deletions

View File

@@ -479,8 +479,10 @@ fi
if [[ "$DISABLE_FW_UPGRADE" == "true" ]]; then
mkdir /tmp/Upgrade
mount -t tmpfs -o size=1,nr_inodes=1 none /tmp/Upgrade
echo -e "127.0.0.1 localhost \n127.0.0.1 wyze-upgrade-service.wyzecam.com" > /opt/wz_mini/tmp/.storage/hosts
mount --bind /opt/wz_mini/tmp/.storage/hosts /etc/hosts
#Setting this host causes iCamera to segfault, lets ignore it for now
#echo -e "127.0.0.1 localhost \n127.0.0.1 wyze-upgrade-service.wyzecam.com" > /opt/wz_mini/tmp/.storage/hosts
#mount --bind /opt/wz_mini/tmp/.storage/hosts /etc/hosts
/opt/wz_mini/bin/busybox inotifyd /opt/wz_mini/usr/bin/watch_up.sh /tmp:n > /dev/null 2>&1 &
else
mkdir /tmp/Upgrade
/opt/wz_mini/bin/busybox inotifyd /opt/wz_mini/usr/bin/watch_up.sh /tmp:n > /dev/null 2>&1 &
@@ -612,7 +614,7 @@ if [ -d "${1:-/opt/wz_mini/etc/rc.local.d}" ] ; then
for filename in $(find /opt/wz_mini/etc/rc.local.d/ -name "*.sh" | /opt/wz_mini/bin/busybox sort) ; do
if [ -f "${filename}" ] && [ -x "${filename}" ]; then
echo "running ${filename}"
"${filename}"
"${filename}" &
fi
done
fi

View File

@@ -1 +1 @@
Thu Jul 14 04:01:23 PM PDT 2022
Fri Jul 15 11:35:28 AM PDT 2022

View File

@@ -2,6 +2,10 @@
DEBUG=false
export WZMINI_CFG=/opt/wz_mini/wz_mini.conf
[ -f $WZMINI_CFG ] && source $WZMINI_CFG
if [ "$DEBUG" == "true" ]; then
if [ -L /dev/fd ]; then
@@ -17,6 +21,11 @@ fi
set -x
if [[ "$DISABLE_FW_UPGRADE" == "true" ]]; then
#Reboot as soon as we see "img", this means an update is incoiming
reboot
fi
event="$1"
directory="$2"
file="$3"