Advertisement
Guest User

Guacamole Docker Install 0.9.14

a guest
Jan 20th, 2018
609
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.55 KB | None | 0 0
  1.  
  2. #!/bin/bash
  3. # WORKING ON UBUNTU 17.10
  4.  
  5. VERSION="0.9.14"
  6.  
  7.  
  8. SERVER=$(curl -s 'https://www.apache.org/dyn/closer.cgi?as_json=1' | jq --raw-output '.preferred|rtrimstr("/")')
  9.  
  10. read -s -p "Enter the password that will be used for MySQL Root: " MYSQLROOTPASSWORD
  11. read -s -p "Enter the password that will be used for the Guacamole database: " GUACDBUSERPASSWORD
  12. read -s -p "Enter the path where you store Guacamole custom configuration in host (/my/data/dir): " GUACPATH
  13.  
  14. # Download the guacamole auth files for MySQL
  15. wget http://xenia.sote.hu/ftp/mirrors/www.apache.org/guacamole/0.9.14/binary/guacamole-auth-jdbc-0.9.14.tar.gz
  16. tar -xzf guacamole-auth-jdbc-0.9.14.tar.gz
  17.  
  18. # Start MySQL
  19. docker run --restart=always --detach --name=mysql --env="MYSQL_ROOT_PASSWORD=$MYSQLROOTPASSWORD" --publish 3306:3306 mysql
  20. sleep 40
  21. # Create the Guacamole database and the user account
  22.  
  23. # SQL Code
  24. SQLCODE="
  25. create database guacamole_db;
  26. create user 'guacamole_user'@'%' identified by '$GUACDBUSERPASSWORD';
  27. GRANT SELECT,INSERT,UPDATE,DELETE ON guacamole_db.* TO 'guacamole_user'@'%';
  28. flush privileges;"
  29.  
  30. # Execute SQL Code
  31. echo $SQLCODE | mysql -h 127.0.0.1 -P 3306 -u root -p$MYSQLROOTPASSWORD
  32.  
  33. cat guacamole-auth-jdbc-${VERSION}/mysql/schema/*.sql | mysql -u root -p$MYSQLROOTPASSWORD -h 127.0.0.1 -P 3306 guacamole_db
  34.  
  35. docker run --restart=always --name guacd -d guacamole/guacd
  36. docker run --restart=always --name guacamole  --link mysql:mysql --link guacd:guacd -v $GUACPATH:/config -e GUACAMOLE_HOME=/config -e MYSQL_HOSTNAME$
  37.  
  38. rm -rf guacamole-auth-jdbc-0.9.14*
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement