From b3bff2d28dcf7174ad1f0fffe163dae40a8e3d2e Mon Sep 17 00:00:00 2001 From: Mitesh Shah Date: Mon, 3 Mar 2014 14:52:49 +0530 Subject: [PATCH 1/5] Check and Install bc command --- install.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/install.sh b/install.sh index c6a10fa7..dd08b79e 100644 --- a/install.sh +++ b/install.sh @@ -69,6 +69,14 @@ then apt-get -y install ed &>> $INSTALLLOG || OwnError "Unable to install ed" fi +# Checking Bc +if [ ! -x /usr/bin/bc ] +then + echo -e "\033[31mBc Command Not Found\e[0m" | tee -ai $INSTALLLOG + echo -e "\033[34mInstalling Bc, Please Wait...\e[0m" | tee -ai $INSTALLLOG + apt-get -y install bc &>> $INSTALLLOG || OwnError "Unable to install bc" +fi + # Checking Wget if [ ! -x /usr/bin/wget ] then From 7f07cae7350226163eb57c78e3c5a14b59b4ce1c Mon Sep 17 00:00:00 2001 From: Mitesh Shah Date: Mon, 3 Mar 2014 15:13:42 +0530 Subject: [PATCH 2/5] Redirect nginx -t errors --- usr/local/sbin/easyengine | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/local/sbin/easyengine b/usr/local/sbin/easyengine index a14ecca7..47f0b0ab 100644 --- a/usr/local/sbin/easyengine +++ b/usr/local/sbin/easyengine @@ -846,7 +846,7 @@ EESITEINFO() NGINXBUCKETSIZE() { - nginx -t 2>&1 | grep server_names_hash_bucket_size + nginx -t 2>&1 | grep server_names_hash_bucket_size &>> $INSTALLLOG if [ $? -eq 0 ] then NGINXCALCULATION=$(echo "l($(ls /etc/nginx/sites-enabled/ | wc -c))/l(2)+2" | bc -l) From d23dc9f940094dc6790af0c9977b7aceaed6ae27 Mon Sep 17 00:00:00 2001 From: Mitesh Shah Date: Mon, 3 Mar 2014 15:21:04 +0530 Subject: [PATCH 3/5] Redirect unwated errors of bc command --- usr/local/sbin/easyengine | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/local/sbin/easyengine b/usr/local/sbin/easyengine index 47f0b0ab..a862ce66 100644 --- a/usr/local/sbin/easyengine +++ b/usr/local/sbin/easyengine @@ -850,7 +850,7 @@ NGINXBUCKETSIZE() if [ $? -eq 0 ] then NGINXCALCULATION=$(echo "l($(ls /etc/nginx/sites-enabled/ | wc -c))/l(2)+2" | bc -l) - NGINXSETBUCKET=$(echo "2^$NGINXCALCULATION" | bc -l) + NGINXSETBUCKET=$(echo "2^$NGINXCALCULATION" | bc -l 2> /dev/null) sed -i "s/.*server_names_hash_bucket_size.*/\tserver_names_hash_bucket_size $NGINXSETBUCKET;/" /etc/nginx/nginx.conf fi } From 0a78ce69bc37f2ad442ecf61d883402ed05d28ba Mon Sep 17 00:00:00 2001 From: Mitesh Shah Date: Tue, 4 Mar 2014 12:32:45 +0530 Subject: [PATCH 4/5] EasyEngine Update: Fixed Issue #134 #148 --- usr/local/sbin/easyengine | 3 +-- usr/local/sbin/eeupdate | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/usr/local/sbin/easyengine b/usr/local/sbin/easyengine index a862ce66..9d8b53a8 100644 --- a/usr/local/sbin/easyengine +++ b/usr/local/sbin/easyengine @@ -2207,8 +2207,7 @@ then # Update EasyEngine echo -e "\033[34mChecking EasyEngine Update, Please Wait...\e[0m" - /bin/bash <(curl -sL https://raw.github.com/rtCamp/easyengine/stable/usr/local/sbin/eeupdate) && exit 0; - exit 0; + /bin/bash <(curl -sL https://raw.github.com/rtCamp/easyengine/stable/usr/local/sbin/eeupdate) else echo -e "\033[34mList Of Available Commands:\e[0m" diff --git a/usr/local/sbin/eeupdate b/usr/local/sbin/eeupdate index e58b1b92..a5035740 100644 --- a/usr/local/sbin/eeupdate +++ b/usr/local/sbin/eeupdate @@ -288,6 +288,11 @@ then echo -e "\033[34mFor EasyEngine (ee) Auto Completion Run Following Command\e[0m" | tee -ai $INSTALLLOG echo -e "\033[37msource /etc/bash_completion.d/ee\e[0m" | tee -ai $INSTALLLOG echo + echo -e "\033[34mEasyEngine (ee) Updated Successfully\e[0m" | tee -ai $INSTALLLOG + + echo -e "\033[34mKilling The Parent Process\e[0m" &>> $INSTALLLOG + ps ax | grep $PPID | grep -v grep &>> $INSTALLLOG + kill -9 $PPID else echo "EasyEngine Already Updated To The Latest Version" From 64c029a7591eb8be78a92c0f7f54766c767935eb Mon Sep 17 00:00:00 2001 From: Mitesh Shah Date: Tue, 4 Mar 2014 12:39:56 +0530 Subject: [PATCH 5/5] Fixed WordPress Permalink and WP-CLI Version --- usr/local/sbin/easyengine | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/usr/local/sbin/easyengine b/usr/local/sbin/easyengine index 9d8b53a8..553cd92e 100644 --- a/usr/local/sbin/easyengine +++ b/usr/local/sbin/easyengine @@ -313,7 +313,7 @@ WP-CLI() then echo -e "\033[31mWP-CLI Command Not Found\e[0m" echo -e "\033[34mInstalling WP-CLI, Please Wait...\e[0m" - curl -sL https://raw.github.com/wp-cli/wp-cli.github.com/master/installer.sh | INSTALL_DIR='/usr/share/easyengine/wp-cli' bash &>> $INSTALLLOG \ + curl -sL https://raw.github.com/wp-cli/wp-cli.github.com/master/installer.sh | INSTALL_DIR='/usr/share/easyengine/wp-cli' VERSION='0.14.1' bash &>> $INSTALLLOG \ || OwnError "Unable To Install WP-CLI" # Add WP-CLI Command In PATH Variable @@ -1021,11 +1021,10 @@ EEWPDBSETUP() --admin_name=$WPADMINUSER --admin_password=$WPADMINPASS --admin_email=$WPADMINEMAIL &>> $INSTALLLOG \ || OwnError "Unable To Create WordPress Tables For $DOMAIN" - # https://github.com/wp-cli/wp-cli/issues/1043 # Update WordPress Permalink Structure Day and Postname - #echo -e "\033[34mUpdating WordPress Permalink, Please Wait...\e[0m" - #wp rewrite structure --allow-root /%year%/%monthnum%/%day%/%postname%/ \ - #|| OwnError "Unable To Update WordPress Permalink For $DOMAIN" + echo -e "\033[34mUpdating WordPress Permalink, Please Wait...\e[0m" + wp rewrite structure --allow-root /%year%/%monthnum%/%day%/%postname%/ &>> $INSTALLLOG \ + || OwnError "Unable To Update WordPress Permalink For $DOMAIN" } EEPERMISSION() @@ -1799,7 +1798,7 @@ then echo -e "\033[37mWordPress Admin Password: $WPADMINPASS\e[0m" echo echo -e "\033[34mPlease Configure The Following Settings...\e[0m" - echo -e "\033[34mPermalink Settings: http://$DOMAIN/wp-admin/options-permalink.php\e[0m" + #echo -e "\033[34mPermalink Settings: http://$DOMAIN/wp-admin/options-permalink.php\e[0m" echo -e "\033[34mW3 Total Cache: http://$DOMAIN/wp-admin/admin.php?page=w3tc_general\e[0m" # Display Success Message @@ -1825,7 +1824,7 @@ then echo -e "\033[37mWordPress Admin Password: $WPADMINPASS\e[0m" echo echo -e "\033[34mPlease Configure The Following Settings...\e[0m" - echo -e "\033[34mPermalink Settings: http://$DOMAIN/wp-admin/options-permalink.php\e[0m" + #echo -e "\033[34mPermalink Settings: http://$DOMAIN/wp-admin/options-permalink.php\e[0m" echo -e "\033[34mWP Super Cache: http://$DOMAIN/wp-admin/options-general.php?page=wpsupercache\e[0m" # Display Success Message @@ -1851,7 +1850,7 @@ then echo -e "\033[37mWordPress Admin Password: $WPADMINPASS\e[0m" echo echo -e "\033[34mPlease Configure The Following Settings...\e[0m" - echo -e "\033[34mPermalink Settings: http://$DOMAIN/wp-admin/options-permalink.php\e[0m" + #echo -e "\033[34mPermalink Settings: http://$DOMAIN/wp-admin/options-permalink.php\e[0m" echo -e "\033[34mNginx Helper: http://$DOMAIN/wp-admin/options-general.php?page=nginx\e[0m" echo -e "\033[34mW3 Total Cache: http://$DOMAIN/wp-admin/admin.php?page=w3tc_general\e[0m" @@ -1911,7 +1910,7 @@ then echo -e "\033[37mWordPress Admin Password: $WPADMINPASS\e[0m" echo echo -e "\033[34mPlease Configure The Following Settings...\e[0m" - echo -e "\033[34mPermalink Settings: http://$DOMAIN/wp-admin/options-permalink.php\e[0m" + #echo -e "\033[34mPermalink Settings: http://$DOMAIN/wp-admin/options-permalink.php\e[0m" echo -e "\033[34mW3 Total Cache: http://$DOMAIN/wp-admin/network/admin.php?page=w3tc_general\e[0m" # Display Success Message @@ -1942,7 +1941,7 @@ then echo -e "\033[37mWordPress Admin Password: $WPADMINPASS\e[0m" echo echo -e "\033[34mPlease Configure The Following Settings...\e[0m" - echo -e "\033[34mPermalink Settings: http://$DOMAIN/wp-admin/options-permalink.php\e[0m" + #echo -e "\033[34mPermalink Settings: http://$DOMAIN/wp-admin/options-permalink.php\e[0m" echo -e "\033[34mWP Super Cache: http://$DOMAIN/wp-admin/network/settings.php?page=wpsupercache\e[0m" # Display Success Message @@ -1973,7 +1972,7 @@ then echo -e "\033[37mWordPress Admin Password: $WPADMINPASS\e[0m" echo echo -e "\033[34mPlease Configure The Following Settings...\e[0m" - echo -e "\033[34mPermalink Settings: http://$DOMAIN/wp-admin/options-permalink.php\e[0m" + #echo -e "\033[34mPermalink Settings: http://$DOMAIN/wp-admin/options-permalink.php\e[0m" echo -e "\033[34mNginx Helper: http://$DOMAIN/wp-admin/network/settings.php?page=nginx\e[0m" echo -e "\033[34mW3 Total Cache: http://$DOMAIN/wp-admin/network/admin.php?page=w3tc_general\e[0m" @@ -2033,7 +2032,7 @@ then echo -e "\033[37mWordPress Admin Password: $WPADMINPASS\e[0m" echo echo -e "\033[34mPlease Configure The Following Settings...\e[0m" - echo -e "\033[34mPermalink Settings: http://$DOMAIN/wp-admin/options-permalink.php\e[0m" + #echo -e "\033[34mPermalink Settings: http://$DOMAIN/wp-admin/options-permalink.php\e[0m" echo -e "\033[34mW3 Total Cache: http://$DOMAIN/wp-admin/network/admin.php?page=w3tc_general\e[0m" # Display Success Message @@ -2064,7 +2063,7 @@ then echo -e "\033[37mWordPress Admin Password: $WPADMINPASS\e[0m" echo echo -e "\033[34mPlease Configure The Following Settings...\e[0m" - echo -e "\033[34mPermalink Settings: http://$DOMAIN/wp-admin/options-permalink.php\e[0m" + #echo -e "\033[34mPermalink Settings: http://$DOMAIN/wp-admin/options-permalink.php\e[0m" echo -e "\033[34mWP Super Cache: http://$DOMAIN/wp-admin/network/settings.php?page=wpsupercache\e[0m" # Display Success Message @@ -2095,7 +2094,7 @@ then echo -e "\033[37mWordPress Admin Password: $WPADMINPASS\e[0m" echo echo -e "\033[34mPlease Configure The Following Settings...\e[0m" - echo -e "\033[34mPermalink Settings: http://$DOMAIN/wp-admin/options-permalink.php\e[0m" + #echo -e "\033[34mPermalink Settings: http://$DOMAIN/wp-admin/options-permalink.php\e[0m" echo -e "\033[34mNginx Helper: http://$DOMAIN/wp-admin/network/settings.php?page=nginx\e[0m" echo -e "\033[34mW3 Total Cache: http://$DOMAIN/wp-admin/network/admin.php?page=w3tc_general\e[0m"