Ok - don't laugh[...]
My coding skills are pitiful so I asked my resident Ai to write a bash
script to call a webcam script (I did write this one) only between
sunrise and sunset. it produced this and it works! My question is - how
can I amend the script so it starts 30 minutes BEFORE sunrise and stops
30 Minutes after?
# Convert sunrise and sunset times to seconds since epoch SUNRISE_EPOCH=$(date -d "$SUNRISE" +%s)
SUNSET_EPOCH=$(date -d "$SUNSET" +%s)
CURRENT_EPOCH=$(date +%s)
Ok - don't laugh[...]
My coding skills are pitiful so I asked my resident Ai to write a bash
script to call a webcam script (I did write this one) only between
sunrise and sunset. it produced this and it works! My question is - how
can I amend the script so it starts 30 minutes BEFORE sunrise and stops
30 Minutes after?
SUNRISE_EPOCH=$(date -d "$SUNRISE" +%s)
SUNSET_EPOCH=$(date -d "$SUNSET" +%s)
CURRENT_EPOCH=$(date +%s)
how can I amend the script so it starts 30 minutes BEFORE sunrise and
stops 30 Minutes after?
... how can I amend the script so it starts 30 minutes BEFORE sunrise
and stops 30 Minutes after?
...
SUNRISE_EPOCH=$(date -d "$SUNRISE" +%s)
SUNSET_EPOCH=$(date -d "$SUNSET" +%s)
On Thu, 12 Dec 2024 12:43:14 +0000, DrStevenStrange wrote:
... how can I amend the script so it starts 30 minutes BEFORE sunrise
and stops 30 Minutes after?
...
SUNRISE_EPOCH=$(date -d "$SUNRISE" +%s)
SUNSET_EPOCH=$(date -d "$SUNSET" +%s)
How about
SUNRISE_EPOCH=$(($(date -d "$SUNRISE" +%s) - 1800))
SUNSET_EPOCH=$(($(date -d "$SUNSET" +%s) + 1800))
On 12/12/2024 12:43, DrStevenStrange wrote:
how can I amend the script so it starts 30 minutes BEFORE sunrise and
stops 30 Minutes after?
Why not just ask the AI goonbot to do that?
Sysop: | Tetrazocine |
---|---|
Location: | Melbourne, VIC, Australia |
Users: | 4 |
Nodes: | 8 (0 / 8) |
Uptime: | 59:38:20 |
Calls: | 65 |
Files: | 21,500 |
Messages: | 73,572 |