doAll.sh 421 B

123456789101112131415161718192021
  1. #!/bin/sh
  2. LOCK="/run/mailman-hacky-subscribtion.lock"
  3. lockfile-check "$LOCK" && exit 0
  4. trap 'lockfile-remove $LOCK' SIGINT SIGTERM SIGHUP SIGQUIT SIGALRM SIGILL SIGABRT SIGPIPE EXIT
  5. lockfile-create "$LOCK"
  6. WORKDIR="$(dirname $(readlink -f "$0"))"
  7. cd "$WORKDIR"
  8. ./fetchMail.sh || exit "$?"
  9. find incoming -type f -exec ./parseMail.sh {} \;
  10. if [ "$(ls -d incoming/new/* 2>/dev/null)" != "" ]; then
  11. exit -1
  12. fi
  13. exit 0