From c682db7db02dbcc2d1bd8bb11b65bbdf530bb8bc Mon Sep 17 00:00:00 2001 From: Mitesh Shah Date: Tue, 31 Dec 2013 17:03:22 +0530 Subject: [PATCH] Fix dpkg -l running on every commands, Now its run with ee system commands only --- usr/local/sbin/easyengine | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/usr/local/sbin/easyengine b/usr/local/sbin/easyengine index 80e60205..f522bf55 100644 --- a/usr/local/sbin/easyengine +++ b/usr/local/sbin/easyengine @@ -28,23 +28,6 @@ echo -e "\033[34mEasyEngine (ee) Execution Started [$(date)]\e[0m" &>> $INSTALLL echo -e "\033[34mEasyEngine (ee) Command: $0 $@\e[0m" &>> $INSTALLLOG -# Check Auto Assume Yes Or No To Apt-Get -grep apt-get-assume-yes /etc/easyengine/ee.conf | grep -i true &>> /dev/null -if [ $? -eq 0 ] -then - EEAPTGET="apt-get -y" -else - # Check Any WebServer Package Is Installed Or Not - dpkg -l | egrep -e 'nginx|php|mysql|postfix|apache' &>> $INSTALLLOG - if [ $? -ne 0 ] - then - EEAPTGET="apt-get -y" - else - EEAPTGET="apt-get" - fi -fi - - # Capture Errors OwnError() { @@ -52,6 +35,25 @@ OwnError() exit 101 } +# Check Auto Assume Yes Or No To Apt-Get +APTASSUMEYES () +{ + grep apt-get-assume-yes /etc/easyengine/ee.conf | grep -i true &>> /dev/null + if [ $? -eq 0 ] + then + EEAPTGET="apt-get -y" + else + # Check Any WebServer Package Is Installed Or Not + dpkg -l | egrep -e 'nginx|php|mysql|postfix|apache' &>> $INSTALLLOG + if [ $? -ne 0 ] + then + EEAPTGET="apt-get -y" + else + EEAPTGET="apt-get" + fi + fi +} + # Install Package Functions PYTHONSOFTWARE() { @@ -1136,6 +1138,8 @@ then elif [ "$1" = "system" ] then + # Check Auto Assume Yes Or No To Apt-Get + APTASSUMEYES # Easy Engine Install if [ "$2" = "install" ]