lab-signal-bot/putzen.sh

43 lines
1.2 KiB
Bash
Raw Permalink 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 4
week=$(expr $(date +%s) / 604800 % 4)
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"
;;
2024-12-29 03:15:27 +01:00
1)
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" 4 "in 7 days" \
2024-12-29 02:53:37 +01:00
--pad-template-url "https://pad.leinelab.org/leinelab-putzen-fortnightly"
;;
2024-12-29 03:15:27 +01:00
2)
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" 4 "in 7 days" \
2024-12-29 02:53:37 +01:00
--pad-template-url "https://pad.leinelab.org/leinelab-putzen-monthly"
;;
2024-12-29 03:15:27 +01:00
3)
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" 4 "in 7 days" \
2024-12-29 02:53:37 +01:00
--pad-template-url "https://pad.leinelab.org/leinelab-putzen-fortnightly"
;;
*)
echo "Invalid choice"
;;
esac