#!/usr/bin/env bash set -e GIT_EXEC="$(command -v git || printf '%s' "")" WGET_EXEC="$(command -v wget || printf '%s' "")" UNZIP_EXEC="$(command -v unzip || printf '%s' "")" MAKE_EXEC="$(command -v make || printf '%s' "")" GITHUB_FALLBACK_URL='https://github.com/ntop/nDPI/archive/refs/heads/dev.zip' if [ -z "${GIT_EXEC}" -o -z "${WGET_EXEC}" -o -z "${UNZIP_EXEC}" -o -z "${MAKE_EXEC}" ]; then printf '%s\n' "Required Executables missing: git, wget, unzip, make" >&2 exit 1 fi LOCKFILE="$(realpath "${0}").lock" touch "${LOCKFILE}" exec 42< "${LOCKFILE}" flock -x -n 42 || { printf '%s\n' "Could not aquire file lock for ${0}. Already running instance?" >&2; exit 1; } if [ ! -z "${CC}" ]; then HOST_TRIPLET="$(${CC} ${CFLAGS} -dumpmachine)" fi if [ ! -z "${MAKEFLAGS}" ]; then MAKEFLAGS="-${MAKEFLAGS}" fi cat <