Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 42 |
Nodes: | 6 (0 / 6) |
Uptime: | 01:30:04 |
Calls: | 220 |
Calls today: | 1 |
Files: | 824 |
Messages: | 121,541 |
Posted today: | 6 |
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?
...
SUNRISE_EPOCH=$(date -d "$SUNRISE" +%s)
SUNSET_EPOCH=$(date -d "$SUNSET" +%s)
how can I amend the script so it starts 30 minutes BEFORE sunrise and
stops 30 Minutes after?
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?