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

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