Advertisement
Guest User

Untitled

a guest
Jul 25th, 2012
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.07 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. function promptmysql {
  4. mysqlstatus=$(service mysql status)
  5.  
  6. if [ "$mysqlstatus" = "mysql stop/waiting" ]; then
  7.     echo "MySQL is not running";
  8. else
  9.     echo -n 'MySQL seems unfortunately not to be running. Do you wish to install MySQL now? [y/n]:';
  10.     read -n ion
  11. fi
  12.  
  13. if [ "$ion" = "y" ]; then
  14.    sudo apt-get install mysql-server mysql-client;
  15.    read -p "You'll now have to set the root password for MySQL. Press [Enter] key to continue..."
  16.    echo -n "Please enter your new password here:"
  17.    read -n mypassword
  18.    sudo mysqladmin -u root -h localhost password '$mypassword'
  19.    read -p "Oops! First you need to create a new empty database called 'openheroes' before you continue. Press [Enter] whenever you're are done..."
  20. elif [ "$ion" = "n" ]; then
  21.      echo "Without MySQL you cannot continue, please install it manually or troubleshoot why the process is not running."
  22. else
  23.      echo "Oops that's no valid option!"
  24.      promptmysql
  25. fi
  26. }
  27.  
  28. promptmysql
  29.    
  30. javac $(find ./* | grep .java);
  31. java Install.Start;
  32. read -p "Press [Enter] key to exit..."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement