Tom Jones | c3b416c | 2024-01-18 14:51:44 +0000 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Ed Warnicke | efa7f9e | 2016-05-01 20:33:53 -0500 | [diff] [blame] | 2 | |
| 3 | # Get Command Line arguements if present |
| 4 | VPP_DIR=$1 |
| 5 | if [ "x$1" != "x" ]; then |
| 6 | VPP_DIR=$1 |
| 7 | else |
| 8 | VPP_DIR=`dirname $0`/../../ |
| 9 | fi |
| 10 | |
| 11 | # Figure out what system we are running on |
| 12 | if [ -f /etc/lsb-release ];then |
| 13 | . /etc/lsb-release |
| 14 | elif [ -f /etc/redhat-release ];then |
Kyle Mestery | acc1fbc | 2018-08-10 16:32:13 -0500 | [diff] [blame] | 15 | sudo -E yum install -y redhat-lsb |
Ed Warnicke | efa7f9e | 2016-05-01 20:33:53 -0500 | [diff] [blame] | 16 | DISTRIB_ID=`lsb_release -si` |
| 17 | DISTRIB_RELEASE=`lsb_release -sr` |
| 18 | DISTRIB_CODENAME=`lsb_release -sc` |
| 19 | DISTRIB_DESCRIPTION=`lsb_release -sd` |
| 20 | fi |
| 21 | echo DISTRIB_ID: $DISTRIB_ID |
| 22 | echo DISTRIB_RELEASE: $DISTRIB_RELEASE |
| 23 | echo DISTRIB_CODENAME: $DISTRIB_CODENAME |
| 24 | echo DISTRIB_DESCRIPTION: $DISTRIB_DESCRIPTION |
| 25 | |
| 26 | if [ $DISTRIB_ID == "Ubuntu" ]; then |
Kyle Mestery | acc1fbc | 2018-08-10 16:32:13 -0500 | [diff] [blame] | 27 | (cd ${VPP_DIR}/build-root/;sudo -E dpkg -i *.deb) |
Ed Warnicke | efa7f9e | 2016-05-01 20:33:53 -0500 | [diff] [blame] | 28 | elif [ $DISTRIB_ID == "CentOS" ]; then |
Kyle Mestery | acc1fbc | 2018-08-10 16:32:13 -0500 | [diff] [blame] | 29 | (cd ${VPP_DIR}/build-root/;sudo -E rpm -Uvh *.rpm) |
| 30 | fi |