malware-filter/src/script.sh

52 lines
1.5 KiB
Bash

## replaced by src/build.js
#!/bin/sh
if ! (set -o pipefail 2>/dev/null); then
# dash does not support pipefail
set -efx
else
set -efx -o pipefail
fi
# bash does not expand alias by default for non-interactive script
if [ -n "$BASH_VERSION" ]; then
shopt -s expand_aliases
fi
alias cp="cp -f"
alias curl="curl -L"
alias mkdir="mkdir -p"
if command -v unzip &> /dev/null
then
alias unzip="unzip -jo"
elif command -v busybox &> /dev/null
then
alias unzip="busybox unzip -jo"
elif command -v bsdunzip &> /dev/null
then
alias unzip="bsdunzip -jo"
else
echo "unzip not found"
exit 1
fi
mkdir "tmp/"
cd "tmp/"
curl "https://gitlab.com/malware-filter/urlhaus-filter/-/jobs/artifacts/main/download?job=pages" -o "urlhaus-filter.zip"
curl "https://gitlab.com/malware-filter/phishing-filter/-/jobs/artifacts/main/download?job=pages" -o "phishing-filter.zip"
curl "https://gitlab.com/malware-filter/pup-filter/-/jobs/artifacts/main/download?job=pages" -o "pup-filter.zip"
curl "https://gitlab.com/malware-filter/tracking-filter/-/jobs/artifacts/main/download?job=pages" -o "tracking-filter.zip"
curl "https://gitlab.com/malware-filter/vn-badsite-filter/-/jobs/artifacts/main/download?job=pages" -o "vn-badsite-filter.zip"
curl "https://gitlab.com/malware-filter/botnet-filter/-/jobs/artifacts/main/download?job=pages" -o "botnet-filter.zip"
for zipfile in $(find . -name "*.zip" -type f)
do
unzip "$zipfile"
done
mkdir "../public/"
find . ! -name "*.zip" -type f | xargs cp -t "../public/"