You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
627 B

#!/bin/bash
BASEDIR=$(dirname "$0")
FILE=${1:-listes.txt}
if ! command -v parallel >/dev/null; then
echo "Please install GNU Parallel: \`sudo apt install parallel\`"
exit 1
fi
cd "$BASEDIR"
echo -n "" >.errors
parallel -a "$FILE" ./monit-sympa.sh
if [[ -f .errors ]]; then
count=$(cat .errors | wc -l)
if [[ $count -gt 0 ]]; then
echo -e "--------------------"
echo -e " \e[0;31m$count\e[0m errors detected!"
echo -e "--------------------"
cat .errors
else
echo -e "\e[0;32m------------------------\e[0m"
echo -e "everything 's \e[0;32mall right!\e[0m"
echo -e "\e[0;32m------------------------\e[0m"
fi
fi