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.

27 lines
588 B

2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
  1. #!/bin/bash
  2. FILE=${1:-listes.txt}
  3. if ! command -v parallel >/dev/null; then
  4. echo "Please install GNU Parallel: \`sudo apt install parallel\`"
  5. exit 1
  6. fi
  7. echo -n "" >.errors
  8. parallel -a "$FILE" ./monit-sympa.sh
  9. if [[ -f .errors ]]; then
  10. count=$(cat .errors | wc -l)
  11. if [[ $count -gt 0 ]]; then
  12. echo -e "--------------------"
  13. echo -e " \e[0;31m$count\e[0m errors detected!"
  14. echo -e "--------------------"
  15. cat .errors
  16. else
  17. echo -e "\e[0;32m------------------------\e[0m"
  18. echo -e "everything 's \e[0;32mall right!\e[0m"
  19. echo -e "\e[0;32m------------------------\e[0m"
  20. fi
  21. fi