<commit_before>leader=$(factom-cli get heights | grep Leader | cut -c 15-)
current=$(factom-cli get heights | grep Directory | cut -c 23-)
difference=$(($leader - $current))
#TODO: Restart if no response from cli

if (($difference > 3))
  then
  sleep 10
  newcurrent=$(factom-cli get heights | grep Directory | cut -c 23-)
  if ((($newcurrent - $current) < 5 ))
    then
    pkill factomd
    sleep 10
    
    #open factomd as a normal bg process
    factomd
    
    #open in a detached screen session named fctd for later retrieval
    #screen -dmS fctd factomd
    
    echo $(date) ": Restarted factomd" >> ~/restart.log
 fi
fi
<commit_msg>simplified<commit_after>leader=$(factom-cli get heights | grep Leader | cut -c 15-)
current=$(factom-cli get heights | grep Directory | cut -c 23-)
difference=$(($leader - $current))
if (($difference > 3))
  then
  sleep 10
  newcurrent=$(factom-cli get heights | grep Directory | cut -c 23-)
  if ((($newcurrent - $current) < 5 ))
    then
    pkill factomd
    sleep 10
    factomd
    #screen -dmS fctd factomd
    echo $(date) ": Restarted factomd" >> ~/restart.log
 fi
fi

{'fraction_non_alphanumeric': 0.1246660730186999, 'fraction_numerical': 0.0213713268032057, 'mean_word_length': 3.072463768115942, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 9, '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': '1402647', 'n_tokens_mistral': 419, 'n_tokens_neox': 367, 'n_words': 131}