|
@ -5,8 +5,8 @@ |
|
|
# Checking Linux Distro Is Ubuntu |
|
|
# Checking Linux Distro Is Ubuntu |
|
|
if [ ! -f /etc/lsb-release ] |
|
|
if [ ! -f /etc/lsb-release ] |
|
|
then |
|
|
then |
|
|
echo -e "\033[31m EasyEngine Is Made For Ubuntu Only As Of Now \e[0m" |
|
|
echo -e "\033[31mEasyEngine (ee) Is Made For Ubuntu Only As Of Now\e[0m" |
|
|
echo -e "\033[31m You Are Free To Fork EasyEngine: https://github.com/rtCamp/easyengine/fork \e[0m" |
|
|
echo -e "\033[31mYou Are Free To Fork EasyEngine (ee): https://github.com/rtCamp/easyengine/fork\e[0m" |
|
|
exit 100 |
|
|
exit 100 |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
@ -16,8 +16,8 @@ fi |
|
|
Permission=$(id -u) |
|
|
Permission=$(id -u) |
|
|
if [ $Permission -ne 0 ] |
|
|
if [ $Permission -ne 0 ] |
|
|
then |
|
|
then |
|
|
echo -e "\033[31m Sudo Privilege Required... \e[0m" |
|
|
echo -e "\033[31mSudo Privilege Required...\e[0m" |
|
|
echo -e "\033[31m Uses:\e[0m\033[34m curl -sL rt.cx/ee | sudo bash \e[0m" |
|
|
echo -e "\033[31mUses:\e[0m\033[34m curl -sL rt.cx/ee | sudo bash\e[0m" |
|
|
exit 100 |
|
|
exit 100 |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
@ -30,7 +30,7 @@ INSTALLLOG=/var/log/easyengine/install.log |
|
|
# Capture Errors |
|
|
# Capture Errors |
|
|
OwnError() |
|
|
OwnError() |
|
|
{ |
|
|
{ |
|
|
echo -e "[ `date` ] \033[31m $@ \e[0m" | tee -ai $INSTALLLOG |
|
|
echo -e "[ `date` ] \033[31m$@\e[0m" | tee -ai $INSTALLLOG |
|
|
exit 101 |
|
|
exit 101 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -40,118 +40,117 @@ OwnError() |
|
|
|
|
|
|
|
|
if [ ! -d $LOGDIR ] |
|
|
if [ ! -d $LOGDIR ] |
|
|
then |
|
|
then |
|
|
echo -e "\033[34m Creating Easy Engine Log Directory, Please Wait... \e[0m" |
|
|
echo -e "\033[34mCreating EasyEngine (ee) Log Directory, Please Wait...\e[0m" |
|
|
mkdir -p $LOGDIR || OwnError "Unable To Create Log Directory $LOGDIR" |
|
|
mkdir -p $LOGDIR || OwnError "Unable To Create Log Directory $LOGDIR" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
echo &>> $INSTALLLOG |
|
|
|
|
|
echo &>> $INSTALLLOG |
|
|
|
|
|
echo -e "\033[34m EasyEngine Installation Started `date +"%d-%b-%Y %H:%M:%S"` \e[0m" | tee -ai $INSTALLLOG |
|
|
|
|
|
|
|
|
|
|
|
# Checking Tee |
|
|
# Checking Tee |
|
|
if [ ! -x /usr/bin/tee ] |
|
|
if [ ! -x /usr/bin/tee ] |
|
|
then |
|
|
then |
|
|
echo -e "\033[31m Tee Command Not Found ! \e[0m" | tee -ai $INSTALLLOG |
|
|
echo -e "\033[31mTee Command Not Found\e[0m" |
|
|
echo -e "\033[34m Installing Tee \e[0m" | tee -ai $INSTALLLOG |
|
|
echo -e "\033[34mInstalling Tee, Please Wait...\e[0m" |
|
|
sudo apt-get -y install coreutils || OwnError "Unable to install tee" |
|
|
sudo apt-get -y install coreutils &>> $INSTALLLOG || OwnError "Unable to install tee" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
echo &>> $INSTALLLOG |
|
|
|
|
|
echo &>> $INSTALLLOG |
|
|
|
|
|
echo -e "\033[34mEasyEngine (ee) Installation Started `date +"%d-%b-%Y %H:%M:%S"`\e[0m" | tee -ai $INSTALLLOG |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Checking Ed |
|
|
# Checking Ed |
|
|
if [ ! -x /bin/ed ] |
|
|
if [ ! -x /bin/ed ] |
|
|
then |
|
|
then |
|
|
echo -e "\033[31m Ed Command Not Found ! \e[0m" | tee -ai $INSTALLLOG |
|
|
echo -e "\033[31mEd Command Not Found\e[0m" | tee -ai $INSTALLLOG |
|
|
echo -e "\033[34m Installing Ed \e[0m" | tee -ai $INSTALLLOG |
|
|
echo -e "\033[34mInstalling Ed, Please Wait...\e[0m" | tee -ai $INSTALLLOG |
|
|
sudo apt-get -y install ed || OwnError "Unable to install ed" |
|
|
sudo apt-get -y install ed &>> $INSTALLLOG || OwnError "Unable to install ed" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
# Checking Wget |
|
|
# Checking Wget |
|
|
if [ ! -x /usr/bin/wget ] |
|
|
if [ ! -x /usr/bin/wget ] |
|
|
then |
|
|
then |
|
|
echo -e "\033[31m Wget Command Not Found ! \e[0m" | tee -ai $INSTALLLOG |
|
|
echo -e "\033[31mWget Command Not Found\e[0m" | tee -ai $INSTALLLOG |
|
|
echo -e "\033[34m Installing Wget \e[0m" | tee -ai $INSTALLLOG |
|
|
echo -e "\033[34mInstalling Wget, Please Wait...\e[0m" | tee -ai $INSTALLLOG |
|
|
sudo apt-get -y install wget || OwnError "Unable To Install Wget" |
|
|
sudo apt-get -y install wget &>> $INSTALLLOG || OwnError "Unable To Install Wget" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
# Checking Curl |
|
|
# Checking Curl |
|
|
if [ ! -x /usr/bin/curl ] |
|
|
if [ ! -x /usr/bin/curl ] |
|
|
then |
|
|
then |
|
|
echo -e "\033[31m Curl Command Not Found ! \e[0m" | tee -ai $INSTALLLOG |
|
|
echo -e "\033[31mCurl Command Not Found\e[0m" | tee -ai $INSTALLLOG |
|
|
echo -e "\033[34m Installing Curl \e[0m" | tee -ai $INSTALLLOG |
|
|
echo -e "\033[34mInstalling Curl, Please Wait...\e[0m" | tee -ai $INSTALLLOG |
|
|
sudo apt-get -y install curl || OwnError "Unable To Install Curl" |
|
|
sudo apt-get -y install curl &>> $INSTALLLOG || OwnError "Unable To Install Curl" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
# Checking Tar |
|
|
# Checking Tar |
|
|
if [ ! -x /bin/tar ] |
|
|
if [ ! -x /bin/tar ] |
|
|
then |
|
|
then |
|
|
echo -e "\033[31m Tar Command Not Found ! \e[0m" | tee -ai $INSTALLLOG |
|
|
echo -e "\033[31mTar Command Not Found\e[0m" | tee -ai $INSTALLLOG |
|
|
echo -e "\033[34m Installing Tar \e[0m" | tee -ai $INSTALLLOG |
|
|
echo -e "\033[34mInstalling Tar, Please Wait...\e[0m" | tee -ai $INSTALLLOG |
|
|
sudo apt-get -y install tar || OwnError "Unable To Install Tar" |
|
|
sudo apt-get -y install tar &>> $INSTALLLOG || OwnError "Unable To Install Tar" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
# Checking Git |
|
|
# Checking Git |
|
|
if [ ! -x /usr/bin/git ] |
|
|
if [ ! -x /usr/bin/git ] |
|
|
then |
|
|
then |
|
|
echo -e "\033[31m Git Command Not Found ! \e[0m" | tee -ai $INSTALLLOG |
|
|
echo -e "\033[31mGit Command Not Found\e[0m" | tee -ai $INSTALLLOG |
|
|
echo -e "\033[34m Installing Git, Please Wait... \e[0m" | tee -ai $INSTALLLOG |
|
|
echo -e "\033[34mInstalling Git, Please Wait...\e[0m" | tee -ai $INSTALLLOG |
|
|
sudo apt-get -y install git-core || OwnError "Unable To Install Git" |
|
|
sudo apt-get -y install git-core &>> $INSTALLLOG || OwnError "Unable To Install Git" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
# Checking Name Servers |
|
|
# Checking Name Servers |
|
|
if [[ -z $(cat /etc/resolv.conf 2> /dev/null | awk '/^nameserver/ { print $2 }') ]] |
|
|
if [[ -z $(cat /etc/resolv.conf 2> /dev/null | awk '/^nameserver/ { print $2 }') ]] |
|
|
then |
|
|
then |
|
|
echo -e "\033[31m No Name Servers Detected ! \e[0m" | tee -ai $INSTALLLOG |
|
|
echo -e "\033[31mNo Name Servers Detected\e[0m" | tee -ai $INSTALLLOG |
|
|
echo -e "\033[31m Please Configure /etc/resolv.conf \e[0m" | tee -ai $INSTALLLOG |
|
|
echo -e "\033[31mPlease Configure /etc/resolv.conf\e[0m" | tee -ai $INSTALLLOG |
|
|
exit 102 |
|
|
exit 102 |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
# Pre Checks End |
|
|
# Pre Checks End |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Check The Easy Engine Is Available |
|
|
# Check The EasyEngine (ee) Is Available |
|
|
EXIST=$(basename `pwd`) |
|
|
EXIST=$(basename `pwd`) |
|
|
if [ "$EXIST" != "easyengine" ] |
|
|
if [ "$EXIST" != "easyengine" ] |
|
|
then |
|
|
then |
|
|
echo -e "\033[34m Cloning Easy Engine, Please Wait... \e[0m" | tee -ai $INSTALLLOG |
|
|
echo -e "\033[34mCloning EasyEngine (ee), Please Wait...\e[0m" | tee -ai $INSTALLLOG |
|
|
|
|
|
|
|
|
# Remove Older Easy Engine If Found |
|
|
# Remove Older EasyEngine (ee) If Found |
|
|
rm -rf /tmp/easyengine &>> /dev/null |
|
|
rm -rf /tmp/easyengine &>> /dev/null |
|
|
|
|
|
|
|
|
# Clone Easy Engine Stable Repository |
|
|
# Clone EasyEngine (ee) Stable Repository |
|
|
git clone -b stable git://github.com/rtCamp/easyengine.git /tmp/easyengine || OwnError "Unable To Clone Easy Engine" |
|
|
git clone -b stable git://github.com/rtCamp/easyengine.git /tmp/easyengine &>> $INSTALLLOG || OwnError "Unable To Clone Easy Engine" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
# Create Directory /etc/easyengine |
|
|
# Create Directory /etc/easyengine |
|
|
if [ ! -d /etc/easyengine ] |
|
|
if [ ! -d /etc/easyengine ] |
|
|
then |
|
|
then |
|
|
# Create A Directory For EE Configurations |
|
|
# Create A Directory For EE Configurations |
|
|
mkdir -p /etc/easyengine \ |
|
|
mkdir -p /etc/easyengine || OwnError "Unable To Create Dir /etc/easyengine" |
|
|
|| OwnError "Unable To Create Dir /etc/easyengine" |
|
|
|
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
# Create Directory /usr/share/easyengine |
|
|
# Create Directory /usr/share/easyengine |
|
|
if [ ! -d /usr/share/easyengine/nginx ] |
|
|
if [ ! -d /usr/share/easyengine/nginx ] |
|
|
then |
|
|
then |
|
|
# Create A Directory For EE Nginx Configurations |
|
|
# Create A Directory For EE Nginx Configurations |
|
|
mkdir -p /usr/share/easyengine/nginx \ |
|
|
mkdir -p /usr/share/easyengine/nginx || OwnError "Unable To Create Dir /usr/share/easyengine/nginx" |
|
|
|| OwnError "Unable To Create Dir /usr/share/easyengine/nginx" |
|
|
|
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
# Install Easy Engine |
|
|
# Install EasyEngine (ee) |
|
|
echo -e "\033[34m Installing Easy Engine, Please Wait... \e[0m" | tee -ai $INSTALLLOG |
|
|
echo -e "\033[34mInstalling EasyEngine (ee), Please Wait...\e[0m" | tee -ai $INSTALLLOG |
|
|
|
|
|
|
|
|
# EE /etc Files |
|
|
# EE /etc Files |
|
|
cp -a /tmp/easyengine/etc/bash_completion.d/ee /etc/bash_completion.d/ &>> /dev/null || OwnError "Unable To Copy EE Auto Complete File" |
|
|
cp -a /tmp/easyengine/etc/bash_completion.d/ee /etc/bash_completion.d/ &>> $INSTALLLOG || OwnError "Unable To Copy EE Auto Complete File" |
|
|
cp -a /tmp/easyengine/etc/easyengine/ee.conf /etc/easyengine/ &>> /dev/null || OwnError "Unable To Copy ee.conf File" |
|
|
cp -a /tmp/easyengine/etc/easyengine/ee.conf /etc/easyengine/ &>> $INSTALLLOG || OwnError "Unable To Copy ee.conf File" |
|
|
|
|
|
|
|
|
# EE /usr/share/easyengine Files |
|
|
# EE /usr/share/easyengine Files |
|
|
cp -a /tmp/easyengine/etc/nginx/* /usr/share/easyengine/nginx/ &>> /dev/null || OwnError "Unable To Copy Configuration Files " |
|
|
cp -a /tmp/easyengine/etc/nginx/* /usr/share/easyengine/nginx/ &>> $INSTALLLOG || OwnError "Unable To Copy Configuration Files " |
|
|
cp -a /tmp/easyengine/usr/share/easyengine/* /usr/share/easyengine/ &>> /dev/null || OwnError "Unable To Copy Configuration Files " |
|
|
cp -a /tmp/easyengine/usr/share/easyengine/* /usr/share/easyengine/ &>> $INSTALLLOG || OwnError "Unable To Copy Configuration Files " |
|
|
|
|
|
|
|
|
# EE Command |
|
|
# EE Command |
|
|
cp -a /tmp/easyengine/usr/local/sbin/easyengine /usr/local/sbin/ &>> /dev/null || OwnError "Unable To Copy EasyEngine Command" |
|
|
cp -a /tmp/easyengine/usr/local/sbin/easyengine /usr/local/sbin/ &>> $INSTALLLOG || OwnError "Unable To Copy EasyEngine Command" |
|
|
|
|
|
|
|
|
# EE Man Pages |
|
|
# EE Man Pages |
|
|
cp -a /tmp/easyengine/man/ee.8 /usr/share/man/man8/ &>> /dev/null || OwnError "Unable To Copy EasyEngine Man Pages" |
|
|
cp -a /tmp/easyengine/man/ee.8 /usr/share/man/man8/ &>> $INSTALLLOG || OwnError "Unable To Copy EasyEngine Man Pages" |
|
|
|
|
|
|
|
|
# Change Permission For EE |
|
|
# Change Permission For EE |
|
|
chmod 750 /usr/local/sbin/easyengine || OwnError "Unable To Change EasyEngine Command Permission" |
|
|
chmod 750 /usr/local/sbin/easyengine || OwnError "Unable To Change EasyEngine Command Permission" |
|
@ -171,13 +170,50 @@ FCSIZE=$(expr $VARRUNSIZE \* 25 / 100) |
|
|
|
|
|
|
|
|
# Change Size |
|
|
# Change Size |
|
|
sed -i "s/500m/$FCSIZE\m/" /usr/share/easyengine/nginx/conf.d/fastcgi.conf || OwnError "Unable To Change Fastcgi Cache Size" |
|
|
sed -i "s/500m/$FCSIZE\m/" /usr/share/easyengine/nginx/conf.d/fastcgi.conf || OwnError "Unable To Change Fastcgi Cache Size" |
|
|
|
|
|
|
|
|
# Source EE Auto Complete To Take Effect |
|
|
# Git Config Settings |
|
|
echo -e "\033[34m For Easy Engine Auto Completion Run Following Command \e[0m" | tee -ai $INSTALLLOG |
|
|
EEGITNAME=$(git config --list | grep name | cut -d'=' -f2) |
|
|
echo -e "\033[34m source /etc/bash_completion.d/ee \e[0m" | tee -ai $INSTALLLOG |
|
|
EEGITEMAIL=$(git config --list | grep email | cut -d'=' -f2) |
|
|
|
|
|
|
|
|
|
|
|
if [ -z $EEGITNAME ] || [ -z $EEGITEMAIL ] |
|
|
|
|
|
then |
|
|
|
|
|
echo |
|
|
|
|
|
echo -e "\033[34mEasyEngine (ee) Required Your Name & Email Address To Track Changes You Made Under The Git\e[0m" | tee -ai $INSTALLLOG |
|
|
|
|
|
echo -e "\033[34mEasyEngine (ee) Will Be Able To Send You Daily Reports & Alerts In Upcoming Version\e[0m" | tee -ai $INSTALLLOG |
|
|
|
|
|
echo -e "\033[34mEasyEngine (ee) Will Never Send Your Information Across\e[0m" | tee -ai $INSTALLLOG |
|
|
|
|
|
fi |
|
|
|
|
|
# Check Git User Is Empty Or Not |
|
|
|
|
|
if [ -z $EEGITNAME ] |
|
|
|
|
|
then |
|
|
|
|
|
read -p "Enter Your Name [$(whoami)]: " EEGITNAME |
|
|
|
|
|
# If Enter Is Pressed |
|
|
|
|
|
if [[ $EEGITNAME = "" ]] |
|
|
|
|
|
then |
|
|
|
|
|
EEGITNAME=$(whoami) |
|
|
|
|
|
fi |
|
|
|
|
|
git config --global user.name "$EEGITNAME" &>> $INSTALLLOG |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# Check Git User Is Empty Or Not |
|
|
|
|
|
if [ -z $EEGITEMAIL ] |
|
|
|
|
|
then |
|
|
|
|
|
read -p "Enter Your Email [$(whoami)@$(hostname -f)]: " EEGITEMAIL |
|
|
|
|
|
# If Enter Is Pressed |
|
|
|
|
|
if [[ $EEGITEMAIL = "" ]] |
|
|
|
|
|
then |
|
|
|
|
|
EEGITEMAIL=$(whoami)@$(hostname -f) |
|
|
|
|
|
fi |
|
|
|
|
|
git config --global user.email $EEGITEMAIL &>> $INSTALLLOG |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Source EasyEngine (ee) Auto Complete To Take Effect |
|
|
|
|
|
echo |
|
|
|
|
|
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 |
|
|
|
|
|
|
|
|
# Display Success Message |
|
|
# Display Success Message |
|
|
echo -e "\033[34m Easy Engine Installed Successfully \e[0m" | tee -ai $INSTALLLOG |
|
|
echo -e "\033[34mEasyEngine (ee) Installed Successfully\e[0m" | tee -ai $INSTALLLOG |
|
|
echo -e "\033[34m Easy Engine Help: http://rtcamp.com/easyengine/docs/ \e[0m" | tee -ai $INSTALLLOG |
|
|
echo -e "\033[34mEasyEngine (ee) Help: http://rtcamp.com/easyengine/docs/\e[0m" | tee -ai $INSTALLLOG |
|
|
echo |
|
|
echo |
|
|