lab-signal-bot/putzen.sh

42 lines
1.2 KiB
Bash
Raw Normal View History

2024-12-29 02:53:37 +01:00
#!/bin/sh
2024-12-29 03:22:31 +01:00
if [ -z "$1" ]; then
# Week number since 1970 modulo 8
week=$(expr $(date +%s) / 604800 % 8)
2024-12-29 03:22:31 +01:00
else
week=$1
fi
2025-01-13 18:17:07 +01:00
current_week=$(date +%V)
next_week=$((current_week + 1))
if [ "$next_week" -gt 52 ]; then
next_week=1
fi
task_title="LeineLab putzen: KW$next_week"
2024-12-29 02:53:37 +01:00
case $week in
2024-12-29 03:15:27 +01:00
0)
2024-12-29 02:53:37 +01:00
/usr/bin/docker exec lab-signal-bot-lab-bot-1 \
2025-01-13 18:17:07 +01:00
python create_task.py "$task_title" 2 "in 7 days" \
2024-12-29 02:53:37 +01:00
--pad-template-url "https://pad.leinelab.org/leinelab-putzen-only-weekly"
;;
2)
2024-12-29 02:53:37 +01:00
/usr/bin/docker exec lab-signal-bot-lab-bot-1 \
python create_task.py "$task_title" 3 "in 7 days" \
2024-12-29 02:53:37 +01:00
--pad-template-url "https://pad.leinelab.org/leinelab-putzen-fortnightly"
;;
4)
2024-12-29 02:53:37 +01:00
/usr/bin/docker exec lab-signal-bot-lab-bot-1 \
python create_task.py "$task_title" 3 "in 7 days" \
2024-12-29 02:53:37 +01:00
--pad-template-url "https://pad.leinelab.org/leinelab-putzen-monthly"
;;
6)
2024-12-29 02:53:37 +01:00
/usr/bin/docker exec lab-signal-bot-lab-bot-1 \
python create_task.py "$task_title" 3 "in 7 days" \
2024-12-29 02:53:37 +01:00
--pad-template-url "https://pad.leinelab.org/leinelab-putzen-fortnightly"
;;
*)
;;
esac