S60recovery 718 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/sh
  2. THIS=$(basename $0)
  3. source /usr/local/lib/utils
  4. case "$1" in
  5. start)
  6. keys=$(devmem 0x01c20500 16)
  7. if [ "${keys}" != "0xF83F" ]; then
  8. # Automatic firmware update requested
  9. updates=$(ls /mnt/FunKey-*.fwu)
  10. if [ "x${updates}" = "x" ]; then
  11. menu &
  12. exit 1
  13. fi
  14. for file in ${updates} ; do
  15. swupdate -i "${file}"
  16. if [ $? -ne 0 ]; then
  17. notif_disp 10 " CORRUPTED^ UPDATE FILE"
  18. rm -f "${file}"
  19. fi
  20. done
  21. notif "^^^^^^^^ RESTARTING...^^^^^^^^"
  22. normal_mode
  23. else
  24. # Manual Recovery mode following Fn + Start keypress during boot
  25. menu &
  26. fi
  27. ;;
  28. stop)
  29. ;;
  30. *)
  31. echo "Usage: $0 {start|stop}" >&2
  32. exit 1
  33. ;;
  34. esac