You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
502 B

  1. #!/bin/sh
  2. . /usr/share/libubox/jshn.sh
  3. case "$1" in
  4. list)
  5. json_init
  6. json_add_object "sysupgrade"
  7. json_close_object
  8. json_dump
  9. ;;
  10. call)
  11. case "$2" in
  12. sysupgrade)
  13. if [ -f "/tmp/sysupgrade.bin" ]; then
  14. /etc/init.d/uhttpd stop
  15. /etc/init.d/dropbear stop
  16. sleep 1;
  17. /sbin/sysupgrade -c /tmp/sysupgrade.bin
  18. fi
  19. json_init
  20. json_add_string "message" "could not find /tmp/sysupgrade.bin"
  21. json_dump
  22. esac
  23. ;;
  24. esac