<commit_before>#!/bin/bash
####
# @see: https://wiki.archlinux.org/index.php/Reflector
# @since 2018-02-01
# @author <NAME> <<EMAIL>>
####

##begin of test
if [[ -f /etc/pacman.d/hooks/trigger_reflector_on_mirrorlist_update.hook ]];
then
    echo ":: Reflector already configured."
    echo ""
    echo ":: Do you want to remove the configuration file? (y|n)"
    read YES_OR_NO

    if [[ ${YES_OR_NO} == "y" ]];
    then
        sudo rm /etc/pacman.d/hooks/trigger_reflector_on_mirrorlist_update.hook
    else
        echo "   If you want to rerun this script, remove following file:"
        echo "   /etc/pacman.d/hooks/trigger_reflector_on_mirrorlist_update.hook"

        exit 1
    fi
fi
##end of test

##begin of installation
#@todo only install if not installed
if [[ ! -f /usr/bin/reflector ]];
then
    echo ":: Installing reflector"
    sudo pacman -S reflector --noconfirm<commit_msg>added restriction to pacman systems only<commit_after>#!/bin/bash
####
# @see: https://wiki.archlinux.org/index.php/Reflector
# @since 2018-02-01
# @author <NAME> <<EMAIL>>
####

#begin of testing if we are on the right system
if [[ ! -f /usr/bin/pacman ]];
then
    echo ":: Can not install on your system."
    echo "   Sorry dude, I can only install things on a arch linux."

    exit 1
fi
#end of testing if we are on the right system

##begin of test
if [[ -f /etc/pacman.d/hooks/trigger_reflector_on_mirrorlist_update.hook ]];
then
    echo ":: Reflector already configured."
    echo ""
    echo ":: Do you want to remove the configuration file? (y|n)"
    read YES_OR_NO

    if [[ ${YES_OR_NO} == "y" ]];
    then
        sudo rm /etc/pacman.d/hooks/trigger_reflector_on_mirrorlist_update.hook
    else
        echo "   If you want to rerun this script, remove following file:"
        echo "   /etc/pacman.d/hooks/trigger_reflector_on_mirrorlist_update.hook"

        exit 1
    fi
fi
##end of test

##begin of installation
#@todo only install if not installed
if [[ ! -f /usr/bin/reflector ]];
then
    echo ":: Installing reflector"
    sudo pacman -S reflector --noconfirm
{'fraction_non_alphanumeric': 0.12536023054755044, 'fraction_numerical': 0.009125840537944284, 'mean_word_length': 3.060428849902534, 'pattern_counts': {'":': 7, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, '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': '7237004', 'n_tokens_mistral': 741, 'n_tokens_neox': 706, 'n_words': 212}