Browse Source

Change Variables For Later Use

old-stable
Mitesh Shah 12 years ago
parent
commit
da273c489d
  1. 10
      setup/install-mysql.sh
  2. 16
      setup/install-nginx.sh
  3. 18
      setup/install-php5.sh
  4. 10
      setup/install-postfix.sh
  5. 35
      setup/pre-checks.sh
  6. 7
      setup/variables.sh

10
setup/install-mysql.sh

@ -5,16 +5,14 @@
# Capture Errors
OwnError()
{
#echo $@ >&2
clear
echo -e "[ $0 ][ `date` ] \033[31m $@ \e[0m" | tee -ai /var/log/easyengine/error.log
exit 100
echo -e "[ $0 ][ `date` ] \033[31m $@ \e[0m" | tee -ai $ERRORLOG
exit 101
}
# Update The APT Cache
sudo apt-get update || OwnError "Unable To Update APT Cache :("
sudo apt-get update || OwnError "Unable To Update APT Cache"
# Install MySQL
sudo apt-get -y install mysql-server mysqltuner || OwnError "Unable To Install MySQL :("
sudo apt-get -y install mysql-server mysqltuner || OwnError "Unable To Install MySQL"

16
setup/install-nginx.sh

@ -5,24 +5,22 @@
# Capture Errors
OwnError()
{
#echo $@ >&2
clear
echo -e "[ $0 ][ `date` ] \033[31m $@ \e[0m" | tee -ai /var/log/easyengine/error.log
exit 100
echo -e "[ $0 ][ `date` ] \033[31m $@ \e[0m" | tee -ai $ERRORLOG
exit 101
}
# Install Python Software Properties
sudo apt-get -y install python-software-properties || OwnError "Unable To Install Python Software Properties :("
sudo apt-get -y install python-software-properties || OwnError "Unable To Install Python Software Properties"
# Add Nginx Launchpad Repository
sudo add-apt-repository ppa:nginx/stable || OwnError "Unable To Add Nginx Launchpad Repository :("
sudo add-apt-repository ppa:nginx/stable || OwnError "Unable To Add Nginx Launchpad Repository"
# Update The APT Cache
sudo apt-get update || OwnError "Unable To Update APT Cache :("
sudo apt-get update || OwnError "Unable To Update APT Cache"
# Install Nginx
sudo apt-get -y install nginx || OwnError "Unable To Install Nginx :("
sudo apt-get -y install nginx || OwnError "Unable To Install Nginx"
# Check Nginx Version
nginx -v || OwnError "Unable To Detect Nginx Version :("
nginx -v || OwnError "Unable To Detect Nginx Version"

18
setup/install-php5.sh

@ -5,25 +5,23 @@
# Capture Errors
OwnError()
{
#echo $@ >&2
clear
echo -e "[ $0 ][ `date` ] \033[31m $@ \e[0m" | tee -ai /var/log/easyengine/error.log
exit 100
echo -e "[ $0 ][ `date` ] \033[31m $@ \e[0m" | tee -ai $ERRORLOG
exit 101
}
# Install Python Software Properties
sudo apt-get -y install python-software-properties || OwnError "Unable To Install Python Software Properties :("
sudo apt-get -y install python-software-properties || OwnError "Unable To Install Python Software Properties"
# Add Nginx Launchpad Repository
sudo add-apt-repository ppa:ondrej/php5 || OwnError "Unable To Add PHP5 Launchpad Repository :("
# Add PHP Launchpad Repository
sudo add-apt-repository ppa:ondrej/php5 || OwnError "Unable To Add PHP5 Launchpad Repository"
# Update The APT Cache
sudo apt-get update || OwnError "Unable To Update APT Cache :("
sudo apt-get update || OwnError "Unable To Update APT Cache"
# Install PHP5
sudo apt-get -y install php5-common php5-mysql php5-xmlrpc php5-cgi php5-curl php5-gd php5-cli php5-fpm php-apc php-pear php5-dev php5-imap php5-mcrypt || OwnError "Unable To Install PHP5 :("
sudo apt-get -y install php5-common php5-mysql php5-xmlrpc php5-cgi php5-curl php5-gd php5-cli php5-fpm php-apc php-pear php5-dev php5-imap php5-mcrypt || OwnError "Unable To Install PHP5"
# Check PHP5 Version
php -v || OwnError "Unable To Detect PHP Version :("
php -v || OwnError "Unable To Detect PHP Version"

10
setup/install-postfix.sh

@ -5,16 +5,14 @@
# Capture Errors
OwnError()
{
#echo $@ >&2
clear
echo -e "[ $0 ][ `date` ] \033[31m $@ \e[0m" | tee -ai /var/log/easyengine/error.log
exit 100
echo -e "[ $0 ][ `date` ] \033[31m $@ \e[0m" | tee -ai $ERRORLOG
exit 101
}
# Update The APT Cache
sudo apt-get update || OwnError "Unable To Update APT Cache :("
sudo apt-get update || OwnError "Unable To Update APT Cache"
# Install Postfix
sudo apt-get -y install postfix || OwnError "Unable To Install Postfix :("
sudo apt-get -y install postfix || OwnError "Unable To Install Postfix"

35
setup/pre-checks.sh

@ -5,38 +5,39 @@
# Capture Errors
OwnError()
{
#echo $@ >&2
clear
echo -e "[ $0 ][ `date` ] \033[31m $@ \e[0m" | tee -ai /var/log/easyengine/error.log
exit 100
echo -e "[ $0 ][ `date` ] \033[31m $@ \e[0m" | tee -ai $ERRORLOG
exit 101
}
# Checking Permissions
Permission=$(id -u)
if [ $Permission -ne 0 ]
then
echo -e "\033[31m Root Privilege Required... \e[0m"
echo -e "\033[31m Root Privilege Required ... \e[0m"
echo -e "\033[31m Uses: sudo $0 \e[0m"
exit 100
exit 100
fi
# Checking Logs Directory
if [ ! -d /var/log/easyengine ]
if [ ! -d $LOGDIR ]
then
mkdir -p /var/log/easyengine || OwnError "Unable To Create Log Directory /var/log/easyengine :("
#else
#echo -e "\033[34m Easy Engine Log Directory Found \e[0m"
#exit
mkdir -p $LOGDIR || OwnError "Unable To Create Log Directory $LOGDIR"
else
echo -e "\033[34m Easy Engine Log Directory Found \e[0m"
fi
# Checking Tee
if [ ! -x /usr/bin/tee ]
then
echo -e "\033[31m Tee Command Not Found !! \e[0m"
echo -e "\033[34m Installing Tee \e[0m"
sudo apt-get -y install coreutils || OwnError "Unable To Install Tee :("
sudo apt-get -y install coreutils || OwnError "Unable To Install Tee"
fi
# Checking Wget
@ -44,7 +45,7 @@ if [ ! -x /usr/bin/wget ]
then
echo -e "\033[31m Wget Command Not Found !! \e[0m"
echo -e "\033[34m Installing Wget \e[0m"
sudo apt-get -y install wget || OwnError "Unable To Install Wget :("
sudo apt-get -y install wget || OwnError "Unable To Install Wget"
fi
# Checking Tar
@ -52,14 +53,14 @@ if [ ! -x /bin/tar ]
then
echo -e "\033[31m Tar Command Not Found !! \e[0m"
echo -e "\033[34m Installing Tar \e[0m"
sudo apt-get -y install tar || OwnError "Unable To Install Tar :("
sudo apt-get -y install tar || OwnError "Unable To Install Tar"
fi
# Checking Name Servers
if [[ -z $(cat /etc/resolv.conf | grep -v ^#) ]]
then
echo -e "\033[31m No Nameservers Detected !! \e[0m"
echo -e "\033[31m Please configure /etc/resolv.conf \e[0m"
echo -e "\033[31m No Nameservers Detected !! \e[0m" | tee -ai $ERRORLOG
echo -e "\033[31m Please configure /etc/resolv.conf \e[0m" | tee -ai $ERRORLOG
exit 100
fi

7
setup/variables.sh

@ -0,0 +1,7 @@
#!/bin/bash
# Make Variables Available For Later Use
export LOGDIR=/var/log/easyengine
export ERRORLOG=/var/log/easyengine/error.log
Loading…
Cancel
Save