<commit_before>#!/bin/sh

if [ -z $LETSENCRYPT_BASE_DIR ]; then

    if [ ! -f ./.env ]; then
	echo 'Error: .env file is required';
    fi

    source ./.env

    if [ -z $LETSENCRYPT_BASE_DIR ]; then
      LETSENCRYPT_BASE_DIR=$(pwd)
      echo 'Warning: LETSENCRYPT_BASE_DIR not defined, using current directory: ' $LETSENCRYPT_BASE_DIR
    fi
    cd ${LETSENCRYPT_BASE_DIR}
fi
CURRENT_MONTH=$(date +%m)

printf "stopping httpd\n";
systemctl stop httpd;
sleep 1;

printf "Updating Certificates ... \n\n"

./letsencrypt-auto -c /etc/letsencrypt/cli.ini certonly --standalone

printf "starting httpd\n";
systemctl start httpd;
<commit_msg>Add support for script running as a symlink from /etc/cron.monthly  -- Requires loading .env file and changing into the appropriate directory  -- This change checks if it is a symlink and handles appropriately<commit_after>#!/bin/sh


LINK=$(readlink -f "$0");

if [ -z $LINK ]; then
    DIR=$PWD
else
    DIR=$(dirname $LINK);
fi

cd $DIR

if [ -z $LETSENCRYPT_BASE_DIR ]; then

    if [ ! -f ./.env ]; then
	echo 'Error: .env file is required';
    fi

    source ./.env

    if [ -z $LETSENCRYPT_BASE_DIR ]; then
      LETSENCRYPT_BASE_DIR=$PWD
      echo 'Warning: LETSENCRYPT_BASE_DIR not defined, using current directory: ' $LETSENCRYPT_BASE_DIR
    fi

fi

CURRENT_MONTH=$(date +%m)
cd ${LETSENCRYPT_BASE_DIR}

printf "stopping httpd\n";
systemctl stop httpd;
sleep 1;

printf "Updating Certificates ... \n\n"

./letsencrypt-auto -c /etc/letsencrypt/cli.ini certonly --standalone

printf "starting httpd\n";
systemctl start httpd;

{'fraction_non_alphanumeric': 0.11984781230183894, 'fraction_numerical': 0.0019023462270133164, 'mean_word_length': 3.395543175487465, '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': '4954170', 'n_tokens_mistral': 600, 'n_tokens_neox': 557, 'n_words': 166}