<commit_before>#!/bin/sh
# A script which checks whether any QEMU-KVM virtual machines are running, or if RAID devices are resyncing.
# Call this script before the actual shutdown (script), this will hold for input if anything needs attention.

if [ "$(ps -ef | grep qemu.* | grep -v grep)" ]
then
    echo "A virtual machine is running."
    read tmp
    exit 1
fi

if [ -e /proc/mdstat ]
then
    numraidtotal=$(cat /proc/mdstat | grep "active raid" | wc -l)
    numraidok=$(cat /proc/mdstat | grep "\[\([0-9]\)\/\1\]"| wc -l)
    if ! [ $numraidtotal -eq $numraidok ]
    then
        echo "RAID device note:"
        cat "/proc/mdstat"
        read tmp
        exit 1
    fi

    if [ "$(cat /proc/mdstat | grep resync)" ]<commit_msg>Only check RAID level 1.<commit_after>#!/bin/sh
# A script which checks whether any QEMU-KVM virtual machines are running, or if RAID devices are resyncing.
# Call this script before the actual shutdown (script), this will hold for input if anything needs attention.

if [ "$(ps -ef | grep qemu.* | grep -v grep)" ]
then
    echo "A virtual machine is running."
    read tmp
    exit 1
fi

if [ -e /proc/mdstat ]
then
    numraidtotal=$(cat /proc/mdstat | grep "active raid1" | wc -l)
    numraidok=$(cat /proc/mdstat | grep "\[\([0-9]\)\/\1\]"| wc -l)
    if ! [ $numraidtotal -eq $numraidok ]
    then
        echo "RAID device note:"
        cat "/proc/mdstat"
        read tmp
        exit 1
    fi

    if [ "$(cat /proc/mdstat | grep resync)" ]
{'fraction_non_alphanumeric': 0.1297043010752688, 'fraction_numerical': 0.008064516129032258, 'mean_word_length': 2.4789719626168223, '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': '2453651', 'n_tokens_mistral': 519, 'n_tokens_neox': 488, 'n_words': 190}