<commit_before>#!/bin/bash
set +o noclobber
cd /var/lib/adom/tmp

versions=('100' '111' '120p3' '120p4' '120p5' 'etr' 'lea' 'swp')
file=()

for v in ${versions[@]}; do
    file=("${file[@]}" "/var/lib/adom/${v}/.HISCORE")
done

update()
{
    /var/lib/adom/bin/adom-$1-bin -S >/dev/null <<EOF

EOF

    if ! cmp hiscore.doc /var/lib/adom/public_html/adom_hiscore/hiscore_v$1.txt
    then
        echo "Hiscore for $1 CHANGED."
        #mv hiscore.doc /var/lib/adom/public_html/adom_hiscore/hiscore_v$1.txt
	cat hiscore.doc > /var/lib/adom/public_html/adom_hiscore/hiscore_v$1.txt
	rm hiscore.doc
    else
        echo "Hiscore for $1 not changed."
    fi
}

inotifywait -e modify -m ${file[@]} |
while read filename eventlist eventfile
do
        rawvers=$(basename $(dirname "$filename"))
        echo "$(date): ${rawvers} updating"
        update $rawvers
done<commit_msg>improve inotify & add dynamic prerelease support<commit_after>#!/bin/bash
set +o noclobber
cd /var/lib/adom/tmp

. /var/lib/adom/etc/config

versions=('100' '111'  'etr' 'lea' 'swp')
for i in $(seq $MIN_PRE $MAX_PRE); do
	versions+=("120p$i")
done
file=()

for v in ${versions[@]}; do
    file=("${file[@]}" "/var/lib/adom/${v}/.HISCORE")
done

update()
{
    /var/lib/adom/bin/adom-$1-bin -S >/dev/null <<EOF

EOF

    if ! cmp hiscore.doc /var/lib/adom/public_html/adom_hiscore/hiscore_v$1.txt
    then
        echo "Hiscore for $1 CHANGED."
        #mv hiscore.doc /var/lib/adom/public_html/adom_hiscore/hiscore_v$1.txt
	cat hiscore.doc > /var/lib/adom/public_html/adom_hiscore/hiscore_v$1.txt
	rm hiscore.doc
    else
        echo "Hiscore for $1 not changed."
    fi
}

inotifywait -e close_write -m ${file[@]} |
while read filename eventlist eventfile
do
        rawvers=$(basename $(dirname "$filename"))
        echo "$(date): ${rawvers} updating"
        update $rawvers
done
{'fraction_non_alphanumeric': 0.16792249730893433, 'fraction_numerical': 0.02099031216361679, 'mean_word_length': 3.1681614349775784, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '2453675', 'n_tokens_mistral': 771, 'n_tokens_neox': 759, 'n_words': 163}