From 837adc7b1723fa6ecd234ef437c787f98cce5404 Mon Sep 17 00:00:00 2001 From: Philipp Matthias Schaefer Date: Sat, 16 May 2020 22:26:07 +0200 Subject: [PATCH] Use offset in check --- invite.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/invite.sh b/invite.sh index 6f1ff8d..7426dc7 100755 --- a/invite.sh +++ b/invite.sh @@ -15,7 +15,7 @@ next_thursday_offset=$(( ( ( 7 - $day_of_week ) + 4 ) % 7 )) ## Check if next Thursday is the first of a month -if (( $(date +%d) > 7 )); then +if (( $(date -d "+$next_thursday_offset days" +%d) > 7 )); then echo "Invitation should be sent at most a week in advance." echo "Exiting without sending an inviation..." exit