-
-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathmirror.sh
executable file
·37 lines (29 loc) · 864 Bytes
/
mirror.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
set -e
echo "Updating..."
DELAY_ARG=""
if [ -z $NVD_API_KEY ]; then
DELAY_ARG="--delay=10000"
else
echo "Using NVD API KEY: ${NVD_API_KEY:0:5}****"
fi
if [ -n "${DELAY}" ]; then
echo "Overriding delay with ${DELAY}ms"
DELAY_ARG="--delay=$DELAY"
fi
MAX_RETRY_ARG=""
if [ -n "${MAX_RETRY}" ]; then
echo "Using max retry attempts: $MAX_RETRY"
MAX_RETRY_ARG="--maxRetry=$MAX_RETRY"
fi
MAX_RECORDS_PER_PAGE_ARG=""
if [ -n "${MAX_RECORDS_PER_PAGE}" ]; then
echo "Using max records per page: $MAX_RECORDS_PER_PAGE"
MAX_RECORDS_PER_PAGE_ARG="--recordsPerPage=$MAX_RECORDS_PER_PAGE"
fi
DEBUG_ARG=""
if [ -n "${DEBUG}" ]; then
echo "Enabling debug mode"
DEBUG_ARG="--debug"
fi
exec java $JAVA_OPT -jar /usr/local/bin/vulnz cve $DELAY_ARG $DEBUG_ARG $MAX_RETRY_ARG $MAX_RECORDS_PER_PAGE_ARG --cache --directory /usr/local/apache2/htdocs