Created
June 7, 2022 18:06
-
-
Save ynonp/40bf49749071c880688ffff416a8a9f8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
evenings_ok=( | |
"Pesach I" | |
"Pesach VII" | |
"Shavuot I" | |
"Tish'a B'Av" | |
"Rosh Hashana II" | |
"Yom Kippur" | |
"Sukkot I" | |
"Shmini Atzeret" | |
) | |
no_emails=( | |
"Rosh Hashana" | |
) | |
for send_in_evening in "${evenings_ok[@]}" | |
do | |
# echo "^[0-9/]+ ${send_in_evening}" | |
if hebcal $(date +"%m %d %Y") | egrep -v "CH''M" | egrep "^[0-9/]+ ${send_in_evening}" >& /dev/null | |
then | |
if (( $(date +%"_H") < 20 )) | |
then | |
exit 1 | |
fi | |
fi | |
done | |
for holiday in "${no_emails[@]}" | |
do | |
if hebcal $(date +"%m %d %Y") | egrep "^[0-9/]+ ${holiday}" >& /dev/null | |
then | |
exit 1 | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment