From 255513e3eaf92f766e3454e71e2d5a84eba0cb91 Mon Sep 17 00:00:00 2001 From: em Date: Mon, 17 Feb 2025 19:52:05 +0100 Subject: [PATCH] MAX_DAYS_OF_YEAR_RANGED_ARG mapping and add FORCE_UPDATE_ARG --- vulnz/src/docker/scripts/mirror.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/vulnz/src/docker/scripts/mirror.sh b/vulnz/src/docker/scripts/mirror.sh index 76f2302..fc95ed5 100755 --- a/vulnz/src/docker/scripts/mirror.sh +++ b/vulnz/src/docker/scripts/mirror.sh @@ -36,12 +36,18 @@ if [ -n "${MAX_RECORDS_PER_PAGE}" ]; then MAX_RECORDS_PER_PAGE_ARG="--recordsPerPage=$MAX_RECORDS_PER_PAGE" fi -MAX_DAYS_OF_YEAR_RANGED="" -if [ -n "${DEBUG}" ]; then +MAX_DAYS_OF_YEAR_RANGED_ARG="" +if [ -n "${$MAX_DAYS_OF_YEAR_RANGED}" ]; then echo "Enabling debug mode" MAX_DAYS_OF_YEAR_RANGED_ARG="--maxDaysOfYearRange=$MAX_DAYS_OF_YEAR_RANGED" fi +FORCE_UPDATE_ARG="" +if [ -n "${FORCE_UPDATE}" ]; then + echo "Enabling debug mode" + FORCE_UPDATE_ARG="--forceUpdate" +fi + DEBUG_ARG="" if [ -n "${DEBUG}" ]; then echo "Enabling debug mode" @@ -59,7 +65,7 @@ max_attempts=5 set +e while [ $attempt -le $max_attempts ]; do - java $JAVA_OPT -jar /usr/local/bin/vulnz cve $DELAY_ARG $DEBUG_ARG $MAX_RETRY_ARG $MAX_RECORDS_PER_PAGE_ARG $MAX_DAYS_OF_YEAR_RANGED_ARG --cache --directory /usr/local/apache2/htdocs + java $JAVA_OPT -jar /usr/local/bin/vulnz cve $DELAY_ARG $DEBUG_ARG $MAX_RETRY_ARG $MAX_RECORDS_PER_PAGE_ARG $MAX_DAYS_OF_YEAR_RANGED_ARG $FORCE_UPDATE_ARG --cache --directory /usr/local/apache2/htdocs exit_code=$? # 100: one or more years of data failed to update; 101 there was an error updating the modified CVE list # if either of these codes are returned, we will retry the update immediately