<commit_before>#!/bin/bash
# LinuxGSM install_logs.sh function
# Author: <NAME>
# Website: https://gameservermanagers.com
# Description: Creates log directories.

local commandname="INSTALL"
local commandaction="Install"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"

if [ "${checklogs}" != "1" ]; then
	echo ""
	echo "Creating log directories"
	echo "================================="
fi
sleep 1
# Create LinuxGSM logs
mkdir -pv "${logdir}"
mkdir -pv "${lgsmlogdir}"
touch "${lgsmlog}"

# Create Console logs
if [ -n "${consolelogdir}" ]; then
	mkdir -pv "${consolelogdir}"
	touch "${consolelog}"
fi

# Create Game logs
if [ -n "${gamelogdir}" ]&&[ ! -d "${gamelogdir}" ]; then
	mkdir -pv "${gamelogdir}"
fi

# Symlink to gamelogdir
# unless gamelogdir is within logdir
# e.g serverfiles/log is not within log/: symlink created
# log/server is in log/: symlink not created
if [ -n "${gamelogdir}" ]; then
	if [ "${gamelogdir:0:${#logdir}}" != "${logdir}" ];then
		ln -nfsv "${gamelogdir}" "${logdir}/server"
	fi
fi

# If server uses SteamCMD create a symbolic link to the Steam logs
if [ -d "${rootdir}/Steam/logs" ]; then
	if [ ! -L "${logdir}/steamcmd" ]; then
		ln -nfsv "${rootdir}/Steam/logs" "${logdir}/steamcmd"
	fi
fi
sleep 1
fn_script_log_info "Logs installed"
<commit_msg>added error checking to log installing<commit_after>#!/bin/bash
# LinuxGSM install_logs.sh function
# Author: <NAME>
# Website: https://gameservermanagers.com
# Description: Creates log directories.

local commandname="INSTALL"
local commandaction="Install"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"

if [ "${checklogs}" != "1" ]; then
	echo ""
	echo "Creating log directories"
	echo "================================="
fi
sleep 1
# Create LinuxGSM logs
echo -ne "installing log dir: ${logdir}..."
mkdir -p "${logdir}"
if [ $? -ne 0 ]; then
	fn_print_fail_eol_nl
	core_exit.sh
else
	fn_print_ok_eol_nl
fi

echo -ne "installing LinuxGSM log dir: ${lgsmlogdir}..."
mkdir -v "${lgsmlogdir}"
if [ $? -ne 0 ]; then
	fn_print_fail_eol_nl
	core_exit.sh
else
	fn_print_ok_eol_nl
fi
echo -ne "creating LinuxGSM log: ${lgsmlog}..."
touch -v "${lgsmlog}"
if [ $? -ne 0 ]; then
	fn_print_fail_eol_nl
	core_exit.sh
else
	fn_print_ok_eol_nl
fi
# Create Console logs
if [ -n "${consolelogdir}" ]; then
	echo -ne "installing console log dir: ${consolelogdir}..."
	mkdir -v "${consolelogdir}"
	if [ $? -ne 0 ]; then
	fn_print_fail_eol_nl
	core_exit.sh
	else
		fn_print_ok_eol_nl
	fi
	echo -ne "creating console log:"
	touch "${consolelog}"
fi

# Create Game logs
if [ -n "${gamelogdir}" ]&&[ ! -d "${gamelogdir}" ]; then
	echo -ne "installing game log dir: ${gamelogdir}..."
	mkdir -v "${gamelogdir}"
	if [ $? -ne 0 ]; then
		fn_print_fail_eol_nl
		core_exit.sh
	else
		fn_print_ok_eol_nl
	fi
fi

# Symlink to gamelogdir
# unless gamelogdir is within logdir
# e.g serverfiles/log is not within log/: symlink created
# log/server is in log/: symlink not created
if [ -n "${gamelogdir}" ]; then
	if [ "${gamelogdir:0:${#logdir}}" != "${logdir}" ];then
		echo -ne "creating symlink to game log dir: ${gamelogdir} > ${logdir}/server..."
		ln -nfsv "${gamelogdir}" "${logdir}/server"
		if [ $? -ne 0 ]; then
			fn_print_fail_eol_nl
			core_exit.sh
		else
			fn_print_ok_eol_nl
		fi
	fi
fi

# If server uses SteamCMD create a symbolic link to the Steam logs
if [ -d "${rootdir}/Steam/logs" ]; then
	if [ ! -L "${logdir}/steamcmd" ]; then
		echo -ne "creating symlink to steam log dir: ${rootdir}/Steam/logs > ${logdir}/steamcmd..."
		ln -nfsv "${rootdir}/Steam/logs" "${logdir}/steamcmd"
		if [ $? -ne 0 ]; then
			fn_print_fail_eol_nl
			core_exit.sh
		else
			fn_print_ok_eol_nl
		fi
	fi
fi
sleep 1
fn_script_log_info "Logs installed"

{'fraction_non_alphanumeric': 0.17145899893503727, 'fraction_numerical': 0.004526091586794462, 'mean_word_length': 4.314002828854314, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '642500', 'n_tokens_mistral': 1482, 'n_tokens_neox': 1409, 'n_words': 405}