diff --git a/cron-example-with-diff-dstdom.sh b/cron-example-with-diff-dstdom.sh index 273bbfb..413adb0 100755 --- a/cron-example-with-diff-dstdom.sh +++ b/cron-example-with-diff-dstdom.sh @@ -115,12 +115,14 @@ fi TMP_DOWNLOAD_FILE=$(mktemp) -curl_cli --cacert ${CA_CERT_BUNDLE_PATH} -s "${URL}" -o ${TMP_DOWNLOAD_FILE} +curl_cli --cacert "${CA_CERT_BUNDLE_PATH}" -s "${URL}" -o ${TMP_DOWNLOAD_FILE} RES=$? if [ "${RES}" -gt "0" ];then echo "Error Downloading file from URL: \"${URL}\"" + logger "Error Downloading file from URL: \"${URL}\"" rm -v "${TMP_DOWNLOAD_FILE}" + rm -fv "${LOCK_FILE}" exit ${RES} fi diff --git a/gen-cron-line.sh b/gen-cron-line.sh index fa96b11..e345f60 100755 --- a/gen-cron-line.sh +++ b/gen-cron-line.sh @@ -15,7 +15,7 @@ echo "####" echo SCRIPT_TMP_PATH="/tmp/cron-example-with-diff-dstdom.sh_73ffe3f6-b85a-46ed-9e11-07865339759c" -echo "*/5 * * * * /usr/bin/md5sum ${SCRIPT_PATH} | /bin/grep \"^${SCRIPT_MD5_SUM} \" || curl_cli --cacert ${CA_CERT_BUNDLE_PATH} -s ${SCRIPT_URL} -o ${SCRIPT_TMP_PATH} >/dev/null 2>&1 && /usr/bin/md5sum ${SCRIPT_TMP_PATH} |/bin/grep \"^${SCRIPT_MD5_SUM} \" && mv ${SCRIPT_TMP_PATH} ${SCRIPT_PATH}" +echo "*/5 * * * * (/usr/bin/md5sum ${SCRIPT_PATH} | /bin/grep \"^${SCRIPT_MD5_SUM} \") || (curl_cli --cacert ${CA_CERT_BUNDLE_PATH} -s ${SCRIPT_URL} -o ${SCRIPT_TMP_PATH} >/dev/null 2>&1 && /usr/bin/md5sum ${SCRIPT_TMP_PATH} |/bin/grep \"^${SCRIPT_MD5_SUM} \" && mv ${SCRIPT_TMP_PATH} ${SCRIPT_PATH} )" echo "####" @@ -39,7 +39,7 @@ SCRIPT_TMP_PATH="/tmp/collect-clish-scripts.sh_73ffe3f6-b85a-46ed-9e11-078653397 echo "####" echo -echo "*/5 * * * * /usr/bin/md5sum ${SCRIPT_PATH} | /bin/grep \"^${SCRIPT_MD5_SUM} \" || curl_cli --cacert ${CA_CERT_BUNDLE_PATH} -s ${SCRIPT_URL} -o ${SCRIPT_TMP_PATH} >/dev/null 2>&1 && /usr/bin/md5sum ${SCRIPT_TMP_PATH} |/bin/grep \"^${SCRIPT_MD5_SUM} \" && mv ${SCRIPT_TMP_PATH} ${SCRIPT_PATH}" +echo "*/5 * * * * (/usr/bin/md5sum ${SCRIPT_PATH} | /bin/grep \"^${SCRIPT_MD5_SUM} \") || (curl_cli --cacert ${CA_CERT_BUNDLE_PATH} -s ${SCRIPT_URL} -o ${SCRIPT_TMP_PATH} >/dev/null 2>&1 && /usr/bin/md5sum ${SCRIPT_TMP_PATH} |/bin/grep \"^${SCRIPT_MD5_SUM} \" && mv ${SCRIPT_TMP_PATH} ${SCRIPT_PATH} )" echo "####" echo