<commit_before>#!/bin/bash

# Stop the demo. This script is definitely not the way to do this in a production environment.
# Note that any running elementsd processes WILL be killed unless owned by a different user!

pkill bob
pkill dave
pkill charlie
pkill alice
pkill fred
pkill -9 elementsd
<commit_msg>stop_demo.sh update<commit_after>#!/bin/bash


if [ -e ./demo.tmp ]; then

    source ./demo.tmp

    gopids=( $dave_pid $alice_pid $charlie_pid $fred_pid $bob_pid )
    for pid in "${gopids[@]}"; do
        if [ -e "/proc/$pid" ]; then
            echo "kill -SIGINT $pid"
            kill -SIGINT $pid
        fi
    done
    sleep 3
    for pid in "${gopids[@]}"; do
        if [ -e "/proc/$pid" ]; then
            echo "kill -9 $pid"
            kill -9 $pid
        fi
    done

    dirs=( $dave_dir $alice_dir $charlie_dir $fred_dir $bob_dir )
    for dir in "${dirs[@]}"; do
        echo "$ELCLI $dir stop"
        $ELCLI $dir stop
    done
    sleep 3
    pids=( $dave_dae $alice_dae $charlie_dae $fred_dae $bob_dae )
    for pid in "${pids[@]}"; do
        if [ -e "/proc/$pid" ]; then
            echo "kill -9 $pid"
            kill -9 $pid
        fi
    done

    rm -f ./demo.tmp

else

    echo "kill processes"

    # Stop the demo. This script is definitely not the way to do this in a production environment.
    # Note that any running elementsd processes WILL be killed unless owned by a different user!

    pkill bob
    pkill dave
    pkill charlie
    pkill alice
    pkill fred
    pkill -9 elementsd

fi

{'fraction_non_alphanumeric': 0.10019518542615485, 'fraction_numerical': 0.00520494469746259, 'mean_word_length': 2.11336032388664, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4840465', 'n_tokens_mistral': 533, 'n_tokens_neox': 510, 'n_words': 196}