2
0

vpncmd-call 913 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/sh
  2. action=$1
  3. shift
  4. case "$action" in
  5. nic-list)
  6. /usr/bin/vpncmd localhost /client /csv /cmd:niclist | tail -n +4 2> /dev/null
  7. ;;
  8. nic-create)
  9. /usr/bin/vpncmd localhost /client /cmd:niccreate $1 > /dev/null && echo "OK" || echo "NOK"
  10. ;;
  11. nic-delete)
  12. /usr/bin/vpncmd localhost /client /csv /cmd:nicdelete $1 > /dev/null && echo "OK" || echo "NOK"
  13. ;;
  14. account-list)
  15. /usr/bin/vpncmd localhost /client /csv /cmd:accountlist | tail -n +4 2> /dev/null
  16. ;;
  17. account-status-get)
  18. /usr/bin/vpncmd localhost /client /csv /cmd:accountstatusget $1 | tail -n +4 2> /dev/null
  19. ;;
  20. *)
  21. echo "Usage:" >&2
  22. echo " $0 {nic-list}" >&2
  23. echo " $0 {nic-create} {name}" >&2
  24. echo " $0 {nic-delete} {name}" >&2
  25. echo " $0 {account-list}" >&2
  26. echo " $0 {account-status-get {accountname}" >&2
  27. exit 1
  28. ;;
  29. esac