Arquivos
wyze-firmware/SD_ROOT/wz_mini/etc/rc.d/S10firmware
T
2022-08-05 19:37:32 -07:00

35 linhas
999 B
Bash

#!/bin/sh
### BEGIN INIT INFO
# Provides:
# Short-Description: FW Upgrade Intercept
# Description: Intercept FW Upgrades from vendor
### END INIT INFO
. /opt/wz_mini/wz_mini.conf
case "$1" in
start)
echo "#####$(basename "$0")#####"
if [[ "$DISABLE_FW_UPGRADE" == "true" ]]; then
mkdir /tmp/Upgrade
mount -t tmpfs -o size=1,nr_inodes=1 none /tmp/Upgrade
#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 &
echo "Firmware updates disabled"
else
echo "Firmwware updates enabled, monitor script running"
mkdir /tmp/Upgrade
/opt/wz_mini/bin/busybox inotifyd /opt/wz_mini/usr/bin/watch_up.sh /tmp:n > /dev/null 2>&1 &
fi
;;
*)
echo "Usage: $0 {start}"
exit 1
;;
esac