dovetail tool: support centos 7 85/32385/1
authorxudan <xudan16@huawei.com>
Thu, 30 Mar 2017 06:39:18 +0000 (06:39 +0000)
committerxudan <xudan16@huawei.com>
Thu, 30 Mar 2017 06:39:18 +0000 (06:39 +0000)
JIRA: DOVETAIL-383

The script launch_db.sh can just support ubuntu now.
Make it support centos 7.

Change-Id: Ic6123ac82cb81bacb2d0c2d394619b8d8d7b3296
Signed-off-by: xudan <xudan16@huawei.com>
utils/launch_db.sh

index 008c960..f368166 100755 (executable)
@@ -82,9 +82,20 @@ echo "================================="
 echo "Upload default project info to DB"
 echo "================================="
 
-# install python packages
-sudo apt-get update > /dev/null
-sudo apt-get install -y python-pip > /dev/null
+# For Ubuntu, there is file /etc/lsb-release
+# For Centos and redhat, there is file /etc/redhat-release
+if [ -f /etc/lsb-release ]; then
+    sudo apt-get update > /dev/null
+    sudo apt-get install -y python-pip > /dev/null
+elif [ -f /etc/redhat-release ]; then
+    sudo yum -y update > /dev/null
+    sudo yum -y install epel-release > /dev/null
+    sudo yum -y install python-pip > /dev/null
+else
+    echo "This operating system is not currently supported."
+    exit 1
+fi
+
 pip install requests > /dev/null
 
 echo "Init DB info..."