#!/bin/bash FILE=${1:-listes.txt} if ! command -v parallel >/dev/null; then echo "Please install GNU Parallel: \`sudo apt install parallel\`" exit 1 fi 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