Advertisement
Guest User

Untitled

a guest
Jun 9th, 2017
592
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.37 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. # Define flags
  4. aoltest=
  5. gmailtest=
  6. hotmailtest=
  7. outlooktest=
  8. yahootest=
  9.  
  10. # Define emails
  11. readonly aoladdr=imhtechtk@aol.com
  12. readonly gmailaddr=imhtechtk@gmail.com
  13. readonly hotmailaddr=imhtechtk@hotmail.com
  14. readonly outlookaddr=imhtechtk@outlook.com
  15. readonly yahooaddr=imhtecktk@yahoo.com
  16.  
  17. # Define pause function
  18.  
  19. pause(){
  20.    read -p "$*"
  21. }
  22.  
  23. # Define test function
  24.  
  25. mailtest() {
  26.     mail -v -s "Test Mail" $1 <<< "This email is to test Quality of Service to your mailing domain. Please disregard and delete this message."
  27.     }
  28.  
  29. # Read in flags
  30.  
  31. while getopts "aghoy" OPTION
  32. do
  33.   case $OPTION in
  34.     a)
  35.         readonly aoltest=1
  36.         ;;
  37.     g)
  38.         readonly gmailtest=1
  39.         ;;
  40.     h)
  41.         readonly hotmailtest=1
  42.         ;;
  43.     o)
  44.         readonly outlooktest=1
  45.         ;;
  46.     y)
  47.         readonly yahootest=1
  48.         ;;
  49.   esac
  50. done
  51.  
  52. # Run on selected addresses
  53.  
  54. if [[ $aoltest -eq 1 ]]; then
  55.     mailtest $aoladdr && pause 'Press [Enter] key to continue...'
  56. fi
  57.  
  58. if [[ $gmailtest -eq 1 ]]; then
  59.     mailtest $gmailaddr && pause 'Press [Enter] key to continue...'
  60. fi
  61.  
  62. if [[ $hotmailtest -eq 1 ]]; then
  63.     mailtest $hotmailaddr && pause 'Press [Enter] key to continue...'
  64. fi
  65.  
  66. if [[ $outlooktest -eq 1 ]]; then
  67.     mailtest $outlookaddr && pause 'Press [Enter] key to continue...'
  68. fi
  69.  
  70. if [[ $yahootest -eq 1 ]]; then
  71.     mailtest $yahooaddr && pause 'Press [Enter] key to continue...'
  72. fi
  73.  
  74. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement