/rel/files/demo.sh

http://github.com/AF83/ucengine · Shell · 50 lines · 32 code · 12 blank · 6 comment · 2 complexity · efeb3c37f87bb92ef8a4e7202ac4c175 MD5 · raw file

  1. #!/bin/sh
  2. CWD=$(dirname $0)
  3. UCENGINE_ADMIN="$CWD/ucengine-admin"
  4. HOST=$1
  5. if [ -z $HOST ];
  6. then
  7. echo "You must provide a domain. $0 <domain>"
  8. exit 1
  9. fi
  10. $UCENGINE_ADMIN $HOST meeting add "demo" --name "Demonstration room" --description "U.C.Engine demonstration room"
  11. $UCENGINE_ADMIN $HOST meeting add "demo2" --name "Another room" --description "Another test room"
  12. # Role participant
  13. $UCENGINE_ADMIN $HOST role add participant
  14. $UCENGINE_ADMIN $HOST role access add participant "add" "presence"
  15. $UCENGINE_ADMIN $HOST role access add participant "add" "roster"
  16. $UCENGINE_ADMIN $HOST role access add participant "get" "meeting"
  17. $UCENGINE_ADMIN $HOST role access add participant "list" "meeting"
  18. $UCENGINE_ADMIN $HOST role access add participant "view" "video"
  19. $UCENGINE_ADMIN $HOST role access add participant "all" "event"
  20. # Role speaker
  21. $UCENGINE_ADMIN $HOST role add speaker
  22. # Role owner
  23. $UCENGINE_ADMIN $HOST role add owner
  24. $UCENGINE_ADMIN $HOST role access add owner "update" "meeting"
  25. $UCENGINE_ADMIN $HOST role access add owner "add" "user.role" --role "speaker"
  26. $UCENGINE_ADMIN $HOST role access add owner "delete" "user.role" --role "speaker"
  27. # Users
  28. USERS="participant participant2 participant3 owner"
  29. for user in $USERS
  30. do
  31. echo "Create user $user"
  32. $UCENGINE_ADMIN $HOST user add $user "password" "pwd"
  33. $UCENGINE_ADMIN $HOST user role add $user "participant"
  34. done
  35. $UCENGINE_ADMIN $HOST user role add "owner" "owner" --location "demo"
  36. $UCENGINE_ADMIN $HOST user role add "owner" "owner" --location "demo2"
  37. # anonymous
  38. $UCENGINE_ADMIN $HOST user add "anonymous" "none" ""