Browse Source

EasyEngine refactor

old-stable
Mitesh Shah 11 years ago
parent
commit
73d7df296b
  1. 3327
      bin/ee
  2. 1
      src/lib/ee_lib_dotdeb.sh
  3. 2
      src/lib/ee_lib_variables.sh
  4. 16
      src/modules/system/install/ee_mod_install_mysql.sh
  5. 2
      src/modules/system/install/ee_mod_install_nginx.sh
  6. 2
      src/modules/system/install/ee_mod_install_php.sh
  7. 2
      src/modules/system/install/ee_mod_repo_nginx.sh
  8. 2
      src/modules/system/install/ee_mod_repo_php.sh
  9. 4
      src/modules/system/install/ee_mod_setup_mysql.sh
  10. 4
      src/modules/system/install/ee_mod_setup_nginx.sh
  11. 2
      src/modules/system/install/ee_mod_setup_php.sh

3327
bin/ee

File diff suppressed because it is too large

1
src/lib/ee_lib_dotdeb.sh

@ -4,6 +4,7 @@ function ee_lib_dotdeb()
{ {
wget --no-check-certificate -cO /tmp/dotdeb.gpg http://www.dotdeb.org/dotdeb.gpg \ wget --no-check-certificate -cO /tmp/dotdeb.gpg http://www.dotdeb.org/dotdeb.gpg \
&>> $EE_COMMAND_LOG || ee_lib_error "Unable to download Dotdeb.org GnuPG key, exit status = " $? &>> $EE_COMMAND_LOG || ee_lib_error "Unable to download Dotdeb.org GnuPG key, exit status = " $?
apt-key add /tmp/dotdeb.gpg &>> $EE_COMMAND_LOG \ apt-key add /tmp/dotdeb.gpg &>> $EE_COMMAND_LOG \
|| ee_lib_error "Unable to add Dotdeb.org GnuPG key, exit status = " $? || ee_lib_error "Unable to add Dotdeb.org GnuPG key, exit status = " $?
} }

2
src/lib/ee_lib_variables.sh

@ -29,7 +29,7 @@ else
readonly EE_PHP_USER=www-data readonly EE_PHP_USER=www-data
fi fi
# Findout MySQL login # Find out MySQL login
if [ -f ~/.my.cnf ];then if [ -f ~/.my.cnf ];then
readonly EE_MYSQL_USER=$(cat ~/.my.cnf | grep user | cut -d'=' -f2) readonly EE_MYSQL_USER=$(cat ~/.my.cnf | grep user | cut -d'=' -f2)
readonly EE_MYSQL_PASS=$(cat ~/.my.cnf | grep pass | cut -d'=' -f2 | sed -e 's/^"//' -e 's/"$//') readonly EE_MYSQL_PASS=$(cat ~/.my.cnf | grep pass | cut -d'=' -f2 | sed -e 's/^"//' -e 's/"$//')

16
src/lib/ee_lib_install_mysql.sh → src/modules/system/install/ee_mod_install_mysql.sh

@ -1,25 +1,29 @@
# Install MySQL Package # Install MySQL Package
ee_lib_install_mysql() ee_mod_install_mysql()
{ {
# Check mysql-server is installed or not # Check MySQL is installed or not
ee_lib_package_check mysql-server ee_lib_package_check mysql-server
# If mysql-server is not installed # If MySQL is not installed
# Then set random mysql password for root user # Then set random MySQL password for root user
if [ -n $PACKAGE_NAME ]; then if [ -n $PACKAGE_NAME ]; then
# setting up mysql password # Setting up MySQL password
local ee_mysql_auto_pass=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 15 | head -n1) local ee_mysql_auto_pass=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 15 | head -n1)
debconf-set-selections <<< "mysql-server mysql-server/root_password password $ee_mysql_auto_pass" debconf-set-selections <<< "mysql-server mysql-server/root_password password $ee_mysql_auto_pass"
debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $ee_mysql_auto_pass" debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $ee_mysql_auto_pass"
# Generate ~/.my.cnf # Generate ~/.my.cnf
echo -e "[client]\nuser=root\npassword=$ee_mysql_auto_pass" > ~/.my.cnf4 echo -e "[client]\nuser=root\npassword=$ee_mysql_auto_pass" > ~/.my.cnf
fi fi
ee_lib_echo "Installing MySQL, please Wait..." ee_lib_echo "Installing MySQL, please Wait..."
$EE_APT_GET install mysql-server mysqltuner percona-toolkit \ $EE_APT_GET install mysql-server mysqltuner percona-toolkit \
|| ee_lib_error "Unable to install MySQL, exit status = " $? || ee_lib_error "Unable to install MySQL, exit status = " $?
# Download tuning-primer.sh
wget --no-check-certificate -cqO /usr/local/bin/tuning-primer.sh https://launchpadlibrarian.net/78745738/tuning-primer.sh
chmod a+x /usr/local/bin/tuning-primer.sh
} }

2
src/lib/ee_lib_install_nginx.sh → src/modules/system/install/ee_mod_install_nginx.sh

@ -1,6 +1,6 @@
# Install nginx package # Install nginx package
function ee_lib_install_nginx() function ee_mod_install_nginx()
{ {
ee_lib_echo "Installing $NGINX_PACKAGE, please wait..." ee_lib_echo "Installing $NGINX_PACKAGE, please wait..."
$EE_APT_GET install $NGINX_PACKAGE || ee_lib_error "Unable to install $NGINX_PACKAGE, exit status = " $? $EE_APT_GET install $NGINX_PACKAGE || ee_lib_error "Unable to install $NGINX_PACKAGE, exit status = " $?

2
src/lib/ee_lib_install_php.sh → src/modules/system/install/ee_mod_install_php.sh

@ -1,6 +1,6 @@
# Install php5-fpm package # Install php5-fpm package
function ee_lib_install_php() function ee_mod_install_php()
{ {
ee_lib_echo "Installing php5, please wait..." ee_lib_echo "Installing php5, please wait..."
$EE_APT_GET install php5-common php5-mysqlnd php5-xmlrpc \ $EE_APT_GET install php5-common php5-mysqlnd php5-xmlrpc \

2
src/lib/ee_lib_repo_nginx.sh → src/modules/system/install/ee_mod_repo_nginx.sh

@ -1,6 +1,6 @@
# Setup nginx repository # Setup nginx repository
function ee_lib_repo_nginx() function ee_mod_repo_nginx()
{ {
if [ "$EE_LINUX_DISTRO" == "Ubuntu" ]; then if [ "$EE_LINUX_DISTRO" == "Ubuntu" ]; then

2
src/lib/ee_lib_repo_php.sh → src/modules/system/install/ee_mod_repo_php.sh

@ -1,6 +1,6 @@
# Setup php5-fpm repository # Setup php5-fpm repository
function ee_lib_repo_php() function ee_mod_repo_php()
{ {
# Ubuntu # Ubuntu
if [ "$EE_LINUX_DISTRO" == "Ubuntu" ]; then if [ "$EE_LINUX_DISTRO" == "Ubuntu" ]; then

4
src/lib/ee_lib_setup_mysql.sh → src/modules/system/install/ee_mod_setup_mysql.sh

@ -1,9 +1,9 @@
# Setup MySQL # Setup MySQL
ee_lib_setup_mysql() function ee_mod_setup_mysql()
{ {
ee_lib_echo "Setting up MySQL, please wait..." ee_lib_echo "Setting up MySQL, please wait..."
# Decrease mysql wait timeout # Setting wait_timeout = 30 & interactive_timeout = 60
sed -i "/#max_connections/a wait_timeout = 30 \ninteractive_timeout = 60" /etc/mysql/my.cnf sed -i "/#max_connections/a wait_timeout = 30 \ninteractive_timeout = 60" /etc/mysql/my.cnf
} }

4
src/lib/ee_lib_setup_nginx.sh → src/modules/system/install/ee_mod_setup_nginx.sh

@ -1,8 +1,8 @@
# Setup nginx # Setup nginx
function ee_lib_setup_nginx() function ee_mod_setup_nginx()
{ {
local ee_ee_whitelist_ip_address local ee_whitelist_ip_address
ee_lib_echo "Setting up nginx, please wait..." ee_lib_echo "Setting up nginx, please wait..."

2
src/lib/ee_lib_setup_php.sh → src/modules/system/install/ee_mod_setup_php.sh

@ -1,6 +1,6 @@
# Setup php5-fpm # Setup php5-fpm
function ee_lib_setup_php() function ee_mod_setup_php()
{ {
ee_lib_echo "Setting up php5, please wait..." ee_lib_echo "Setting up php5, please wait..."
Loading…
Cancel
Save