X-Git-Url: https://gerrit.fd.io/r/gitweb?p=one.git;a=blobdiff_plain;f=tutorial%2Fsetup_lisp_topo.sh;fp=tutorial%2Fsetup_lisp_topo.sh;h=872ccd8382837755d8f083b35c108c6c414dae08;hp=d349e8d4ce0cacf02bb9224145ba1ee97affcd5f;hb=40841eaf9aa969c275a900f05ad2352d75e6aab4;hpb=69e02f9476e9b616a9d53d6202ff5f6c11775bdc diff --git a/tutorial/setup_lisp_topo.sh b/tutorial/setup_lisp_topo.sh index d349e8d..872ccd8 100755 --- a/tutorial/setup_lisp_topo.sh +++ b/tutorial/setup_lisp_topo.sh @@ -1,5 +1,19 @@ +#!/usr/bin/env bash + +if [ $USER != "root" ] ; then + echo "Restarting script with sudo..." + sudo $0 ${*} + exit +fi + + +SRC=${1:-/vpp} +[ $# -eq 0 ] && { echo "(using default vpp src $SRC. This can be passed as parameter to script)"; } + # path to vpp executable and configurations folder -VPP_LITE_BIN=/vpp/build-root/install-vpp_lite_debug-native/vpp/bin/vpp +[ -f $SRC/build-root/install-vpp_lite_debug-native/vpp/bin/vpp ] || { echo "VPP lite not found, build it by 'cd $SRC; PLATFORM=vpp_lite make build'"; exit 1; } + +VPP_LITE_BIN=$SRC/build-root/install-vpp_lite_debug-native/vpp/bin/vpp VPP_LITE_CONF=/etc/vpp/lite/ # make sure there are no vpp instances running