aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2022-09-13 13:53:29 +0200
committerToni Uhlig <matzeton@googlemail.com>2022-09-13 13:53:48 +0200
commitaca1615dc13bac949d507c493e9cef80fd2402ef (patch)
treece8abb5d5722d312ccc2b96e959ef855d5e69290 /scripts
parent94aa02b298321005b6334262242c30eeb94549ae (diff)
OpenWrt packaging support.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/get-and-build-libndpi.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/get-and-build-libndpi.sh b/scripts/get-and-build-libndpi.sh
index 75158b43c..35a6bd8b1 100755
--- a/scripts/get-and-build-libndpi.sh
+++ b/scripts/get-and-build-libndpi.sh
@@ -2,6 +2,8 @@
set -e
+GITHUB_FALLBACK_URL='https://github.com/ntop/nDPI/archive/refs/heads/dev.zip'
+
LOCKFILE="$(realpath "${0}").lock"
touch "${LOCKFILE}"
exec 42< "${LOCKFILE}"
@@ -35,6 +37,16 @@ set -x
cd "$(dirname "${0}")/.."
if [ -d ./.git ]; then
git submodule update --init ./libnDPI
+else
+ printf '%s' '-----------------------------------'
+ printf 'WARNING: %s is supposed to be a GIT repository. But it is not.' "$(realpath $(dirname "${0}")/..)"
+ printf '%s' 'Can not clone libnDPI as GIT submodule.'
+ printf '%s' 'Falling back to Github direct download.'
+ printf 'URL: %s' "${GITHUB_FALLBACK_URL}"
+ printf '%s' '-----------------------------------'
+ wget "${GITHUB_FALLBACK_URL}" -O ./libnDPI-github-dev.zip
+ unzip ./libnDPI-github-dev.zip
+ mv ./nDPI-dev ./libnDPI
fi
cd ./libnDPI