Add countdown/newyeard support to all cronjobs. - annna - Annna the nice friend… | |
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
--- | |
commit bd27303540f31dfdc4a549513db01ec95c012294 | |
parent c0057dc11ffb38e29ac6bd63691f02cf5d40c39e | |
Author: Annna Robert-Houdin <[email protected]> | |
Date: Sun, 26 Feb 2023 18:48:53 +0100 | |
Add countdown/newyeard support to all cronjobs. | |
Diffstat: | |
M chinese-newyear-cronjob | 2 ++ | |
A countdownd | 14 ++++++++++++++ | |
M ed-cronjob | 2 ++ | |
M groundhog-cronjob | 2 ++ | |
M newyear-cronjob | 2 ++ | |
M rs-232-cronjob | 2 ++ | |
6 files changed, 24 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/chinese-newyear-cronjob b/chinese-newyear-cronjob | |
@@ -8,6 +8,8 @@ curdate="$(LANG=C date -I)" | |
if [ "${curdate}" = "${cnyprior}" ]; | |
then | |
annna-say -s "irc.bitreich.org" -c "#bitreich-en" "One day until Chine… | |
+ | |
+ countdownd "$(date -d "+ 1 day" -I)" "#bitreich-en" "Chinese New Year" | |
fi | |
if [ "${curdate}" = "${chinesenewyear}" ]; | |
diff --git a/countdownd b/countdownd | |
@@ -0,0 +1,14 @@ | |
+#!/bin/sh | |
+ | |
+if [ $# -lt 3 ]; | |
+then | |
+ printf "usage: %s YYYY-MM-DD irc-channel description\n" "$(basename "$… | |
+ exit 1 | |
+fi | |
+ | |
+exe="/home/20h/scm/newyeard/newyeard.py" | |
+ | |
+{ | |
+ $exe -c "$2" -d "$3" "$1" & | |
+} & | |
+ | |
diff --git a/ed-cronjob b/ed-cronjob | |
@@ -7,6 +7,8 @@ curdate="$( (echo obase=16; date +%j) | bc )" | |
if [ "${curdate}" = "EC" ]; | |
then | |
annna-say -c "#bitreich-en" "One day until ED day! gophers://bitreich.… | |
+ | |
+ countdownd $(date -d "+ 1 day" -I) "#bitreich-en" "ED day" | |
fi | |
if [ "${curdate}" = "ED" ]; | |
diff --git a/groundhog-cronjob b/groundhog-cronjob | |
@@ -7,6 +7,8 @@ curdate="$(LANG=C date -I | cut -d- -f 2-)" | |
if [ "${curdate}" = "02-01" ]; | |
then | |
annna-say -s "irc.libera.chat" -c "#gopherproject" "One day until Grou… | |
+ | |
+ countdownd $(date -d "+ 1 day" -I) "irc.libera.chat/#gopherproject" "G… | |
fi | |
if [ "${curdate}" = "02-02" ]; | |
diff --git a/newyear-cronjob b/newyear-cronjob | |
@@ -7,6 +7,8 @@ curdate="$(LANG=C date -I | cut -d- -f 2-)" | |
if [ "${curdate}" = "12-31" ]; | |
then | |
annna-say -s "irc.bitreich.org" -c "#bitreich-en" "One day until New Y… | |
+ | |
+ countdownd $(date -d "+ 1 day" -I) "#bitreich-en" "New Year" | |
fi | |
if [ "${curdate}" = "01-01" ]; | |
diff --git a/rs-232-cronjob b/rs-232-cronjob | |
@@ -7,6 +7,8 @@ curdate="$( date +%j )" | |
if [ "${curdate}" = "231" ]; | |
then | |
annna-say -c "#bitreich-en" "One day until RS-232 day! gopher://gopher… | |
+ | |
+ countdownd $(date -d "+ 1 day" -I) "#bitreich-en" "RS-232 Day" | |
fi | |
if [ "${curdate}" = "232" ]; |