<commit_before>#!/bin/bash -e
# Location where to install on cPanel server
CPANEL_DIR="/var/cpanel/easy/apache/custom_opt_mods"

if [ ! -d "$CPANEL_DIR" ]; then
	echo "$CPANEL_DIR not found. This script should only be used on servers that have cPanel installed."
	exit 1
fi

# Download & tar mod_cloudflare.c
mkdir mod_cloudflare && cd mod_cloudflare && wget "https://raw.githubusercontent.com/cloudflare/mod_cloudflare/master/mod_cloudflare.c" && cd ..
tar -cvzf $CPANEL_DIR/Cpanel/Easy/ModCloudflare.pm.tar.gz mod_cloudflare/mod_cloudflare.c
# Download ModCloudflare.pm into cPanel directory
wget -P $CPANEL_DIR/Cpanel/Easy/ wget https://raw.githubusercontent.com/cloudflare/mod_cloudflare/master/EasyApache/ModCloudflare.pm
# Remove leftover files
rm -rf mod_cloudflare/<commit_msg>Added check for install dir<commit_after>#!/bin/bash -e
# Location where to install on cPanel server
CPANEL_DIR="/var/cpanel/easy/apache/custom_opt_mods"
INSTALL_DIR="$CPANEL_DIR/Cpanel/Easy"

if [ ! -d "$CPANEL_DIR" ]; then
	echo "$CPANEL_DIR not found. This script should only be used on servers that have cPanel installed."
	exit 1
fi

if [ ! -d "$INSTALL_DIR" ]; then
	mkdir -p "$INSTALL_DIR"
fi

# Download & tar mod_cloudflare.c
mkdir mod_cloudflare && cd mod_cloudflare && wget "https://raw.githubusercontent.com/cloudflare/mod_cloudflare/master/mod_cloudflare.c" && cd ..
tar -cvzf $INSTALL_DIR/ModCloudflare.pm.tar.gz mod_cloudflare/mod_cloudflare.c
# Download ModCloudflare.pm into cPanel directory
wget -P $INSTALL_DIR/ https://raw.githubusercontent.com/cloudflare/mod_cloudflare/master/EasyApache/ModCloudflare.pm
# Remove leftover files
rm -rf mod_cloudflare/
{'fraction_non_alphanumeric': 0.10983705491852747, 'fraction_numerical': 0.0012070006035003018, 'mean_word_length': 5.095588235294118, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5157999', 'n_tokens_mistral': 618, 'n_tokens_neox': 564, 'n_words': 137}