background-job 644 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/usr/bin/env bash
  2. NAME=""
  3. COMMAND_FILE=""
  4. ENV_FILE=""
  5. MAIL_NOTIFICATION=""
  6. NOTIFICATION_SCRIPT=""
  7. PID=$$
  8. USAGE="Usage: `basename $0` [-h] [-n name] [-e env-file] [-m mail-address] [-N notifier]"
  9. while getopts hn:e:m:N: OPT; do
  10. case "$OPT" in
  11. h)
  12. echo $USAGE
  13. exit 0
  14. ;;
  15. n)
  16. NAME=$OPTARG
  17. ;;
  18. e)
  19. ENV_FILE=$OPTARG
  20. ;;
  21. m)
  22. MAIL_NOTIFICATION=$OPTARG
  23. ;;
  24. N)
  25. NOTIFICATION_SCRIPT=$OPTARG
  26. ;;
  27. \?)
  28. echo $USAGE >&2
  29. exit 1
  30. ;;
  31. esac
  32. done