aria2-call 479 B

12345678910111213141516171819202122232425
  1. #!/bin/sh
  2. . "$IPKG_INSTROOT/usr/share/libubox/jshn.sh"
  3. action=$1
  4. shift
  5. case "$action" in
  6. cat)
  7. case "$1" in
  8. conf|session)
  9. config_dir="$(uci -q get aria2.main.config_dir)"
  10. list_file="${config_dir:-/var/etc/aria2}/aria2.$1.main"
  11. json_init
  12. json_add_string file "$list_file"
  13. json_add_string content "$(cat "$list_file")"
  14. json_dump
  15. ;;
  16. esac
  17. ;;
  18. tail)
  19. log_file=$(uci -q get aria2.main.log)
  20. tail -n 50 "${log_file:-/var/log/aria2.log}"
  21. ;;
  22. esac