<commit_before>#!/bin/bash
# LinuxGSM check_last_update.sh function
# Author: <NAME>
# Website: https://linuxgsm.com
# Description: Checks lock file to see when last update happened.
# Will reboot server if instance not rebooted since update.

if [ -f "${lockdir}/${selfname}-laststart.lock" ]; then
	laststart=$(cat "${lockdir}/${selfname}-laststart.lock")
fi
if [ -f "${lockdir}/lastupdate.lock" ]; then
	lastupdate=$(cat "${lockdir}/lastupdate.lock")
fi

if [ ! -f "${lockdir}/${selfname}-laststart.lock" ]||[ "${laststart}" -lt "${lastupdate}" ]; then
	fn_print_info "${selfname} has not been restarted since last update"
	fn_script_log_info "${selfname} has not been restarted since last update"
	command_restart.sh
fi
<commit_msg>prevent last update check running if lock file last update lock missing<commit_after>#!/bin/bash
# LinuxGSM check_last_update.sh function
# Author: <NAME>
# Website: https://linuxgsm.com
# Description: Checks lock file to see when last update happened.
# Will reboot server if instance not rebooted since update.

if [ -f "${lockdir}/${selfname}-laststart.lock" ]; then
	laststart=$(cat "${lockdir}/${selfname}-laststart.lock")
fi
if [ -f "${lockdir}/lastupdate.lock" ]; then
	lastupdate=$(cat "${lockdir}/lastupdate.lock")
fi

if [ -f "${lockdir}/lastupdate.lock" ]; then
	if [ ! -f "${lockdir}/${selfname}-laststart.lock" ]||[ "${laststart}" -lt "${lastupdate}" ]; then
		fn_print_info "${selfname} has not been restarted since last update"
		fn_script_log_info "${selfname} has not been restarted since last update"
		command_restart.sh
	fi
fi

{'fraction_non_alphanumeric': 0.1560328490208465, 'fraction_numerical': 0.0, 'mean_word_length': 5.211764705882353, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6183199', 'n_tokens_mistral': 513, 'n_tokens_neox': 501, 'n_words': 152}