X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=extras%2Fvagrant%2Frun.sh;h=be2d842590364566943f1ec00f47fe3e84eefe06;hb=HEAD;hp=1cd3382640af6c6e89a5aafe1a863ca5ad02f52a;hpb=48009e4c5732180ecc951ac6359b9b96d38b8dc2;p=vpp.git diff --git a/extras/vagrant/run.sh b/extras/vagrant/run.sh index 1cd3382640a..be2d8425903 100755 --- a/extras/vagrant/run.sh +++ b/extras/vagrant/run.sh @@ -1,23 +1,23 @@ -#!/bin/bash +#!/usr/bin/env bash # Figure out what system we are running on -if [ -f /etc/lsb-release ];then - . /etc/lsb-release -elif [ -f /etc/redhat-release ];then - yum install -y redhat-lsb - DISTRIB_ID=`lsb_release -si` - DISTRIB_RELEASE=`lsb_release -sr` - DISTRIB_CODENAME=`lsb_release -sc` - DISTRIB_DESCRIPTION=`lsb_release -sd` +if [ "$(uname)" <> "Darwin" ] ; then + OS_ID=$(grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g') + OS_VERSION_ID=$(grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g') fi -if [ $DISTRIB_ID == "CentOS" ]; then +if [ "$OS_ID" == "ubuntu" ] ; then + $OS_CODENAME=$UBUNTU_CODENAME +fi + +if [ "$OS_ID" == "centos" ] ; then # Install uio-pci-generic - modprobe uio_pci_generic + sudo -E modprobe uio_pci_generic fi + echo "Starting VPP..." -if [ $DISTRIB_ID == "Ubuntu" ] && [ $DISTRIB_CODENAME = "trusty" ] ; then - start vpp +if [ "$OS_ID" == "ubuntu" ] && [ "$OS_CODENAME" == "trusty" ] ; then + sudo -E start vpp else - service vpp start + sudo -E service vpp start fi