<commit_before>#!/bin/bash

PUPPET_OPTS="--detailed-exitcodes --color=false"
PUPPET_MANIFEST="<%= @manifest_file %>"

if [ "$EUID" -ne "0" ]; then
  echo "This script must be run as root." 1>&2
  exit 1
fi

apt-get -qq update
cd "<%= @conf_dir %>"
puppet apply --logdest syslog $PUPPET_OPTS $PUPPET_MANIFEST &
PID=$!
wait $PID

<% if !<EMAIL>? && !@mail_to.empty? -%>
if [ "$?" -gt 0 ]; then
  grep -F "puppet-user[${PID}]" /var/log/syslog | mail -s "<%= @mail_subject %>" <%= @mail_to %>
fi
<% end -%>

exit 0<commit_msg>No longer run apt as part of the script<commit_after>#!/bin/bash

PUPPET_OPTS="--detailed-exitcodes --color=false"
PUPPET_MANIFEST="<%= @manifest_file %>"

if [ "$EUID" -ne "0" ]; then
  echo "This script must be run as root." 1>&2
  exit 1
fi

cd "<%= @conf_dir %>"
puppet apply --logdest syslog $PUPPET_OPTS $PUPPET_MANIFEST &
PID=$!
wait $PID

<% if !<EMAIL>? && !<EMAIL>.empty? -%>
if [ "$?" -gt 0 ]; then
  grep -F "puppet-user[${PID}]" /var/log/syslog | mail -s "<%= @mail_subject %>" <%= @mail_to %>
fi
<% end -%>

exit 0
{'fraction_non_alphanumeric': 0.21619047619047618, 'fraction_numerical': 0.011428571428571429, 'mean_word_length': 3.8211009174311927, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 20, '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': '7527680', 'n_tokens_mistral': 491, 'n_tokens_neox': 448, 'n_words': 114}