2021-07-18 12:37:53 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
SCRIPT_MD5_SUM=$( md5sum collect-clish-scripts-daemon.sh |awk '{print $1}' )
|
|
|
|
SCRIPT_URL="https://raw.githubusercontent.com/elico/cp-tls-inspection-application-update-cron/master/collect-clish-scripts-daemon.sh"
|
|
|
|
SCRIPT_PATH="/storage/collect-clish-scripts-daemon.sh"
|
2021-07-18 12:41:50 +03:00
|
|
|
USERSCRIPT_PATH="/pfrm2.0/etc/userScript"
|
2021-07-18 12:43:46 +03:00
|
|
|
LOCK_FILE="/tmp/clish-scripts-collector-cron-lockfile"
|
2021-07-18 12:37:53 +03:00
|
|
|
|
|
|
|
echo -e "#!/usr/bin/env bash
|
|
|
|
|
|
|
|
logger \"Starting /pfrm2.0/etc/userScript\"
|
2021-07-18 12:43:46 +03:00
|
|
|
|
|
|
|
rm -f -v "${LOCK_FILE}"
|
|
|
|
|
2021-07-18 12:37:53 +03:00
|
|
|
wget ${SCRIPT_URL} \\
|
|
|
|
-O ${SCRIPT_PATH} && \\
|
2021-07-18 12:41:50 +03:00
|
|
|
md5sum ${SCRIPT_PATH} | grep \"^${SCRIPT_MD5_SUM} \" >/dev/null && \\
|
2021-07-18 15:37:55 +03:00
|
|
|
bash ${SCRIPT_PATH} >/dev/null 2>&1 &
|
2021-07-18 12:37:53 +03:00
|
|
|
logger \"Exiting /pfrm2.0/etc/userScript\""
|