-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Let's Encrypt] Add extended logging of cron task execution #297 #298
Conversation
scripts/auto-update-ssl-cert.sh
Outdated
|
||
_exp_date_unixtime=$(date --date="$exp_date" "+%s"); | ||
_cur_date_unixtime=$(date "+%s"); | ||
_delta_time=$(( $_exp_date_unixtime - $_cur_date_unixtime )); | ||
|
||
[[ $_delta_time -le $seconds_before_expire ]] && { | ||
echo "$(date) - update required" >> /var/log/letsencrypt.log; | ||
echo "$(date) - update required" >> ${LOG_FILE}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we already have the stdout redirection at the upper level, so you don't need to do this manually.
scripts/auto-update-ssl-cert.sh
Outdated
@@ -68,16 +69,17 @@ seconds_before_expire=$(( $DAYS_BEFORE_EXPIRE * 24 * 60 * 60 )); | |||
$( [[ -e /usr/bin/python ]] || ln -s /usr/bin/python3 /usr/bin/python ) | |||
[[ -f "/var/lib/jelastic/SSL/jelastic.crt" && "$withExtIp" != "false" ]] && exp_date=$(jem ssl checkdomain | python -c "import sys, json; print (json.load(sys.stdin)['expiredate'])"); | |||
|
|||
[ -z "$exp_date" ] && { echo "$(date) - no certificates for update" >> /var/log/letsencrypt.log; exit 0; }; | |||
[ -z "$exp_date" ] && { echo "$(date) - no certificates for update" >> ${LOG_FILE}; exit 0; }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we already have the stdout redirection at the upper level, so you don't need to do this manually.
scripts/auto-update-ssl-cert.sh
Outdated
@@ -10,6 +10,7 @@ GIT=$(which git); | |||
BASE_REPO_URL="https://github.com/jelastic-jps/lets-encrypt" | |||
RAW_REPO_SCRIPS_URL="https://raw.githubusercontent.com/jelastic-jps/lets-encrypt/master/scripts/" | |||
SETTINGS_CUSTOM="/var/lib/jelastic/keys/letsencrypt/settings-custom" | |||
LOG_FILE="/var/log/letsencrypt.log" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
scripts/auto-update-ssl-cert.sh
Outdated
validateLatestVersion | ||
resp=$($WGET --no-check-certificate -qO- "${auto_update_url}"); | ||
echo ${resp} >> ${LOG_FILE}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we already have the stdout redirection at the upper level, so you don't need to do this manually.
Co-authored-by: Slava Katiukha <v.katiukha@gmail.com>
No description provided.