5 TREX_DOWNLOAD_REPO="https://github.com/cisco-system-traffic-generator/trex-core/archive/"
6 TREX_DOWNLOAD_PACKAGE="v${TREX_VERSION}.zip"
7 TREX_PACKAGE_URL="${TREX_DOWNLOAD_REPO}${TREX_DOWNLOAD_PACKAGE}"
9 TREX_DIR="trex-core-${TREX_VERSION}/"
10 TREX_INSTALL_DIR="${TARGET_DIR}${TREX_DIR}"
12 if test "$(id -u)" -ne 0
14 echo "Please use root or sudo to be able to access target installation directory: ${TARGET_DIR}"
18 WORKING_DIR=$(mktemp -d)
19 test $? -eq 0 || exit 1
27 test -d ${TREX_INSTALL_DIR} && echo "T-REX aleready installed: ${TREX_INSTALL_DIR}" && exit 0
29 wget -P ${WORKING_DIR} ${TREX_PACKAGE_URL}
30 test $? -eq 0 || exit 1
32 unzip ${WORKING_DIR}/${TREX_DOWNLOAD_PACKAGE} -d ${TARGET_DIR}
33 test $? -eq 0 || exit 1
35 cd ${TREX_INSTALL_DIR}/linux_dpdk/ && ./b configure && ./b build || exit 1
36 cd ${TREX_INSTALL_DIR}/scripts/ko/src && make && make install || exit 1