Browse Source

Better way to detect the linux distibution #136

old-stable
Mitesh Shah 11 years ago
parent
commit
c6020033d4
  1. 9
      usr/local/sbin/easyengine

9
usr/local/sbin/easyengine

@ -4,6 +4,7 @@
LOGDIR=/var/log/easyengine LOGDIR=/var/log/easyengine
ERRORLOG=/var/log/easyengine/error.log ERRORLOG=/var/log/easyengine/error.log
INSTALLLOG=/var/log/easyengine/install.log INSTALLLOG=/var/log/easyengine/install.log
LINUX_DISTRO=$(lsb_release -i | cut -d':' -f2 | awk '{print $1}')
# Main EasyEngine Function To Log All The Outputs # Main EasyEngine Function To Log All The Outputs
EasyEngine() EasyEngine()
@ -53,14 +54,14 @@ PYTHONSOFTWARE()
NGINXREPO() NGINXREPO()
{ {
if [ -f /etc/lsb-release ] if [ "$LINUX_DISTRO" == "Ubuntu" ]
then then
# Add Nginx Launchpad Repository # Add Nginx Launchpad Repository
echo -e "\033[34mAdding Brianmercer Nginx Launchpad Repository, Please Wait...\e[0m" echo -e "\033[34mAdding Brianmercer Nginx Launchpad Repository, Please Wait...\e[0m"
add-apt-repository -y ppa:brianmercer/nginx &>> $INSTALLLOG \ add-apt-repository -y ppa:brianmercer/nginx &>> $INSTALLLOG \
|| OwnError "Unable To Add Nginx Launchpad Repository" || OwnError "Unable To Add Nginx Launchpad Repository"
elif [ -f /etc/debian_version ] elif [ "$LINUX_DISTRO" == "Debian" ]
then then
# Add Nginx DotDeb Repository # Add Nginx DotDeb Repository
echo -e "\033[34mAdding Nginx DotDeb Repository, Please Wait...\e[0m" echo -e "\033[34mAdding Nginx DotDeb Repository, Please Wait...\e[0m"
@ -75,14 +76,14 @@ NGINXREPO()
PHPREPO() PHPREPO()
{ {
if [ -f /etc/lsb-release ] if [ "$LINUX_DISTRO" == "Ubuntu" ]
then then
# Add PHP Launchpad Repository # Add PHP Launchpad Repository
echo -e "\033[34mAdding Ondrej PHP5 Launchpad Repository, Please Wait...\e[0m" echo -e "\033[34mAdding Ondrej PHP5 Launchpad Repository, Please Wait...\e[0m"
add-apt-repository -y ppa:ondrej/php5 &>> $INSTALLLOG \ add-apt-repository -y ppa:ondrej/php5 &>> $INSTALLLOG \
|| OwnError "Unable To Add PHP5 Launchpad Repository" || OwnError "Unable To Add PHP5 Launchpad Repository"
elif [ -f /etc/debian_version ] elif [ "$LINUX_DISTRO" == "Debian" ]
then then
# Detect Debian Version To Select PHP Repo # Detect Debian Version To Select PHP Repo
DEBIAN_VERSION=$(lsb_release -r | awk '{print($2)}' | cut -d'.' -f1) DEBIAN_VERSION=$(lsb_release -r | awk '{print($2)}' | cut -d'.' -f1)

Loading…
Cancel
Save