Browse Source

Better Help

old-stable
Mitesh Shah 12 years ago
parent
commit
bf788c2024
  1. 80
      setup/engine

80
setup/engine

@ -6,17 +6,17 @@
Permission=$(id -u) Permission=$(id -u)
if [ $Permission -ne 0 ] if [ $Permission -ne 0 ]
then 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" echo -e "\033[31m Uses: sudo $0 \e[0m"
exit 100 exit 100
fi fi
# Capture Errors # Capture Errors
OwnError() OwnError()
{ {
echo -e "[ $0 ][ `date` ] \033[31m $@ \e[0m" | tee -ai $ERRORLOG echo -e "[ $0 ][ `date` ] \033[31m $@ \e[0m" | tee -ai $ERRORLOG
exit 101 exit 101
} }
@ -35,9 +35,15 @@ EngineHelp()
echo echo
echo "OPTIONS:" echo "OPTIONS:"
echo " `basename $0` [system] [install|remove|purge] [nginx|php|mysql|postfix|--all]" echo " `basename $0` [system] [install|remove|purge] [nginx|php|mysql|postfix|--all]"
echo " `basename $0` [site] [read|craete|update|delete] [sitename]"
echo " `basename $0` [config] [set|get] [memory|timeout]" echo " `basename $0` [site] [read] [--all|--active|sitename]"
echo " `basename $0` [site] [create] [sitename] [--with-wordpress]"
echo " `basename $0` [site] [update] [sitename] []"
echo " `basename $0` [site] [delete] [sitename] [--with-data]"
#echo " `basename $0` [site] [read|craete|update|delete] [sitename]"
echo " `basename $0` [config] [set|get] [memory|timeout]"
echo echo
echo "Exit status:" echo "Exit status:"
@ -51,41 +57,41 @@ EngineHelp()
if [ ! -d $LOGDIR ] if [ ! -d $LOGDIR ]
then then
echo -e "\033[34m Creating easyengine log directory... \e[0m" echo -e "\033[34m Creating easyengine log directory... \e[0m"
mkdir -p $LOGDIR || OwnError "Unable to create log directory $LOGDIR" mkdir -p $LOGDIR || OwnError "Unable to create log directory $LOGDIR"
else #else
echo -e "\033[34m Easyengine log directory found... \e[0m" #echo -e "\033[34m Easyengine log directory found... \e[0m"
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" echo -e "\033[31m Tee command not found !! \e[0m"
echo -e "\033[34m Installing tee \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 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" echo -e "\033[31m Wget command not found !! \e[0m"
echo -e "\033[34m Installing wget \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 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" echo -e "\033[31m Tar command not found !! \e[0m"
echo -e "\033[34m Installing tar \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 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 nameservers detected !! \e[0m" | tee -ai $ERRORLOG 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 echo -e "\033[31m Please configure /etc/resolv.conf \e[0m" | tee -ai $ERRORLOG
exit 100 exit 100
fi fi
# Pre Checks End # Pre Checks End
@ -294,13 +300,39 @@ then
EngineHelp EngineHelp
fi fi
#fi #fi
# Easy Engine Help
else else
EngineHelp EngineHelp
fi fi
elif [ "$1" = "site" ] elif [ "$1" = "site" ]
then then
echo "Under Developments !!" # Easy Engine Read
if [ "$2" = "read" ]
then
if [ "$3" =
# Easy Engine Create
elif [ "$2" = "create" ]
then
# Easy Engine Update
elif [ "$2" = "update" ]
then
# Easy Engine Delete
elif [ "$2" = "delete" ]
then
# Easy Engine Help
else
fi
#echo "Under Developments !!"
elif [ "$1" = "config" ] elif [ "$1" = "config" ]
then then

Loading…
Cancel
Save