Browse Source

Better Installations

old-stable
Mitesh Shah 12 years ago
parent
commit
4d3fb0637f
  1. 47
      install.sh

47
install.sh

@ -12,6 +12,11 @@ then
fi fi
# Make Variables Available For Later Use
LOGDIR=/var/log/easyengine
INSTALLLOG=/var/log/easyengine/install.log
# Capture Errors # Capture Errors
OwnError() OwnError()
{ {
@ -19,29 +24,22 @@ OwnError()
exit 101 exit 101
} }
# Make Variables Available For Later Use
LOGDIR=/var/log/easyengine
INSTALLLOG=/var/log/easyengine/install.log
# Pre Checks To Avoid Later Screw Ups # Pre Checks To Avoid Later Screw Ups
# Checking Logs Directory # Checking Logs Directory
echo &>> $INSTALLLOG echo &>> $INSTALLLOG
echo &>> $INSTALLLOG echo &>> $INSTALLLOG
echo -e "\033[34m EasyEngine Installation Started `date +%d-%b-%Y:%H:%M:%S` \e[0m" | tee -ai $INSTALLLOG echo -e "\033[34m EasyEngine Installation Started `date +"%d-%b-%Y %H:%M:%S"` \e[0m" | tee -ai $INSTALLLOG
if [ ! -d $LOGDIR ] if [ ! -d $LOGDIR ]
then then
echo -e "\033[34m Creating Easy Engine Log Directory... \e[0m" | tee -ai $INSTALLLOG echo -e "\033[34m Creating Easy Engine Log Directory, Please Wait... \e[0m" | tee -ai $INSTALLLOG
mkdir -p $LOGDIR || OwnError "Unable To Create Log Directory $LOGDIR" mkdir -p $LOGDIR || OwnError "Unable To Create Log Directory $LOGDIR"
fi fi
# 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[31m Tee Command Not Found ! \e[0m" | tee -ai $INSTALLLOG
echo -e "\033[34m Installing Tee \e[0m" | tee -ai $INSTALLLOG echo -e "\033[34m Installing Tee \e[0m" | tee -ai $INSTALLLOG
sudo apt-get -y install coreutils || OwnError "Unable to install tee" sudo apt-get -y install coreutils || OwnError "Unable to install tee"
fi fi
@ -49,7 +47,7 @@ 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[31m Wget Command Not Found ! \e[0m" | tee -ai $INSTALLLOG
echo -e "\033[34m Installing Wget \e[0m" | tee -ai $INSTALLLOG echo -e "\033[34m Installing Wget \e[0m" | tee -ai $INSTALLLOG
sudo apt-get -y install wget || OwnError "Unable To Install Wget" sudo apt-get -y install wget || OwnError "Unable To Install Wget"
fi fi
@ -57,7 +55,7 @@ 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[31m Tar Command Not Found ! \e[0m" | tee -ai $INSTALLLOG
echo -e "\033[34m Installing Tar \e[0m" | tee -ai $INSTALLLOG echo -e "\033[34m Installing Tar \e[0m" | tee -ai $INSTALLLOG
sudo apt-get -y install tar || OwnError "Unable To Install Tar" sudo apt-get -y install tar || OwnError "Unable To Install Tar"
fi fi
@ -65,7 +63,7 @@ fi
# Checking Name Servers # Checking Name Servers
if [[ -z $(cat /etc/resolv.conf | grep -v ^#) ]] if [[ -z $(cat /etc/resolv.conf | grep -v ^#) ]]
then then
echo -e "\033[31m No Name Servers Detected !! \e[0m" | tee -ai $INSTALLLOG echo -e "\033[31m No 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[31m Please Configure /etc/resolv.conf \e[0m" | tee -ai $INSTALLLOG
exit 102 exit 102
fi fi
@ -73,19 +71,19 @@ 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[31m Git Command Not Found ! \e[0m" | tee -ai $INSTALLLOG
echo -e "\033[34m Installing Git, Please Wait... \e[0m" | tee -ai $INSTALLLOG echo -e "\033[34m Installing 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 || OwnError "Unable To Install Git"
fi fi
# Checking WP-CLI # Checking WP-CLI
if [ ! -d /root/wp-cli ] #if [ ! -d /root/wp-cli ]
then #then
echo -e "\033[31m WP Command Not Found !! \e[0m" # echo -e "\033[31m WP Command Not Found ! \e[0m"
echo -e "\033[34m Installing WP-CLI, Please Wait... \e[0m" # echo -e "\033[34m Installing WP-CLI, Please Wait... \e[0m"
git clone git://github.com/wp-cli/wp-cli.git /root/wp-cli # git clone git://github.com/wp-cli/wp-cli.git /root/wp-cli
sudo /root/wp-cli/utils/dev-build || OwnError "Unable To Build WP-CLI" # sudo /root/wp-cli/utils/dev-build || OwnError "Unable To Build WP-CLI"
fi #fi
# Pre Checks End # Pre Checks End
@ -95,19 +93,22 @@ 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[34m Cloning Easy Engine, Please Wait... \e[0m" | tee -ai $INSTALLLOG
cd /tmp
# Remove Older Easy Engine If Found # Remove Older Easy Engine If Found
cd /tmp
rm -rf /tmp/easyengine &>> /dev/null rm -rf /tmp/easyengine &>> /dev/null
# Git Clone # Git Clone
git clone git://github.com/rtCamp/easyengine.git || OwnError "Unable To Clone Easy Engine" git clone git://github.com/rtCamp/easyengine.git || OwnError "Unable To Clone Easy Engine"
# Change Directory
cd easyengine cd easyengine
fi fi
# Create Directory /usr/share/easyengine # Create Directory /usr/share/easyengine
if [ ! -d /usr/share/easyengine ] if [ ! -d /usr/share/easyengine ]
then then
# Create A Directory For EE Configurations
mkdir -p /usr/share/easyengine \ mkdir -p /usr/share/easyengine \
|| OwnError "Unable To Create Dir /usr/share/easyengine" || OwnError "Unable To Create Dir /usr/share/easyengine"
fi fi

Loading…
Cancel
Save