Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- # Define flags
- aoltest=
- gmailtest=
- hotmailtest=
- outlooktest=
- yahootest=
- # Define emails
- readonly aoladdr=imhtechtk@aol.com
- readonly gmailaddr=imhtechtk@gmail.com
- readonly hotmailaddr=imhtechtk@hotmail.com
- readonly outlookaddr=imhtechtk@outlook.com
- readonly yahooaddr=imhtecktk@yahoo.com
- # Define pause function
- pause(){
- read -p "$*"
- }
- # Define test function
- mailtest() {
- mail -v -s "Test Mail" $1 <<< "This email is to test Quality of Service to your mailing domain. Please disregard and delete this message."
- }
- # Read in flags
- while getopts "aghoy" OPTION
- do
- case $OPTION in
- a)
- readonly aoltest=1
- ;;
- g)
- readonly gmailtest=1
- ;;
- h)
- readonly hotmailtest=1
- ;;
- o)
- readonly outlooktest=1
- ;;
- y)
- readonly yahootest=1
- ;;
- esac
- done
- # Run on selected addresses
- if [[ $aoltest -eq 1 ]]; then
- mailtest $aoladdr && pause 'Press [Enter] key to continue...'
- fi
- if [[ $gmailtest -eq 1 ]]; then
- mailtest $gmailaddr && pause 'Press [Enter] key to continue...'
- fi
- if [[ $hotmailtest -eq 1 ]]; then
- mailtest $hotmailaddr && pause 'Press [Enter] key to continue...'
- fi
- if [[ $outlooktest -eq 1 ]]; then
- mailtest $outlookaddr && pause 'Press [Enter] key to continue...'
- fi
- if [[ $yahootest -eq 1 ]]; then
- mailtest $yahooaddr && pause 'Press [Enter] key to continue...'
- fi
- exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement