S10firmware 999 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides:
  4. # Short-Description: FW Upgrade Intercept
  5. # Description: Intercept FW Upgrades from vendor
  6. ### END INIT INFO
  7. . /opt/wz_mini/wz_mini.conf
  8. case "$1" in
  9. start)
  10. echo "#####$(basename "$0")#####"
  11. if [[ "$DISABLE_FW_UPGRADE" == "true" ]]; then
  12. mkdir /tmp/Upgrade
  13. mount -t tmpfs -o size=1,nr_inodes=1 none /tmp/Upgrade
  14. #Setting this host causes iCamera to segfault, lets ignore it for now
  15. #echo -e "127.0.0.1 localhost \n127.0.0.1 wyze-upgrade-service.wyzecam.com" > /opt/wz_mini/tmp/.storage/hosts
  16. #mount --bind /opt/wz_mini/tmp/.storage/hosts /etc/hosts
  17. /opt/wz_mini/bin/busybox inotifyd /opt/wz_mini/usr/bin/watch_up.sh /tmp:n > /dev/null 2>&1 &
  18. echo "Firmware updates disabled"
  19. else
  20. echo "Firmwware updates enabled, monitor script running"
  21. mkdir /tmp/Upgrade
  22. /opt/wz_mini/bin/busybox inotifyd /opt/wz_mini/usr/bin/watch_up.sh /tmp:n > /dev/null 2>&1 &
  23. fi
  24. ;;
  25. *)
  26. echo "Usage: $0 {start}"
  27. exit 1
  28. ;;
  29. esac