<commit_before>#!/usr/bin/env sh
set -e

GRACE_DAYS=$1
if [ -z ${GRACE_DAYS} ]; then
    GRACE_DAYS=$GRACEDAYS
fi

if [ "$(ls -A /usr/local/etc/haproxy/haproxy.cfg.d/)" ]; then
    for i in `ls -v /usr/local/etc/haproxy/haproxy.cfg.d/`; do
        DOMAIN=${i##*/}
        if [ -d "$LETSENCRYPT_LIVE_DIR/$DOMAIN" ]; then
            echo "Checking cert expiration: $DOMAIN"
            date=`echo | openssl x509 -enddate -noout -in $LETSENCRYPT_LIVE_DIR/$DOMAIN/fullchain.pem | grep notAfter | sed -e 's#notAfter=##'`
            diff="$(/datediff.py "$date")"

            if test "${diff}" -lt "${GRACE_DAYS}";
            then
                if test "${diff}" -lt "0";
                then
                    echo "The certificate for ${DOMAIN} has already expired."
                else
                    echo "The certificate for ${DOMAIN} will expire in ${diff} days."
                fi
                letsencrypt certonly -n --text --webroot --webroot-path $WEBROOT_DIR -d $DOMAIN --renew-by-default --agree-tos --email $E_MAIL
            fi
        else
            echo "WARNING: Skipping $DOMAIN"
        fi
    done;
fi<commit_msg>renew cert email param fix<commit_after>#!/usr/bin/env sh
set -e

GRACE_DAYS=$1
if [ -z ${GRACE_DAYS} ]; then
    GRACE_DAYS=$GRACEDAYS
fi

if [ "$(ls -A /usr/local/etc/haproxy/haproxy.cfg.d/)" ]; then
    for i in `ls -v /usr/local/etc/haproxy/haproxy.cfg.d/`; do
        DOMAIN=${i##*/}
        if [ -d "$LETSENCRYPT_LIVE_DIR/$DOMAIN" ]; then
            echo "Checking cert expiration: $DOMAIN"
            date=`echo | openssl x509 -enddate -noout -in $LETSENCRYPT_LIVE_DIR/$DOMAIN/fullchain.pem | grep notAfter | sed -e 's#notAfter=##'`
            diff="$(/datediff.py "$date")"

            if test "${diff}" -lt "${GRACE_DAYS}";
            then
                if test "${diff}" -lt "0";
                then
                    echo "The certificate for ${DOMAIN} has already expired."
                else
                    echo "The certificate for ${DOMAIN} will expire in ${diff} days."
                fi
                letsencrypt certonly -n --text --webroot --webroot-path $WEBROOT_DIR -d $DOMAIN --renew-by-default --agree-tos --email $(cat /usr/local/etc/haproxy/haproxy.cfg.d/$DOMAIN/email)
            fi
        else
            echo "WARNING: Skipping $DOMAIN"
        fi
    done;
fi
{'fraction_non_alphanumeric': 0.14412886816447648, 'fraction_numerical': 0.00423908435777872, 'mean_word_length': 1.7797408716136631, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7209378', 'n_tokens_mistral': 842, 'n_tokens_neox': 797, 'n_words': 206}