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.

31 lines
557 B

  1. #!/bin/sh
  2. . /usr/share/libubox/jshn.sh
  3. . /usr/share/wginstaller/wg_functions.sh
  4. case "$1" in
  5. list)
  6. cmd='{ "get_usage": {},'
  7. cmd=$(echo "$cmd" ' "register": {"mtu":"1400", "public_key": "xyz"} }')
  8. echo "$cmd"
  9. ;;
  10. call)
  11. case "$2" in
  12. get_usage)
  13. read -r input
  14. logger -t "wginstaller" "call" "$2" "$input"
  15. wg_get_usage
  16. ;;
  17. register)
  18. read -r input
  19. logger -t "wginstaller" "call" "$2" "$input"
  20. json_load "$input"
  21. json_get_var mtu mtu
  22. json_get_var public_key public_key
  23. wg_register "$uplink_bw" "$mtu" "$public_key"
  24. ;;
  25. esac
  26. ;;
  27. esac