2024-12-12 16:11 : id 407
This commit is contained in:
parent
428f2be7d8
commit
67edd7ebbc
@ -119,18 +119,15 @@ in
|
||||
text = ''
|
||||
#!/bin/bash
|
||||
# Set your latitude and longitude
|
||||
LATITUDE="52.489471"
|
||||
LONGITUDE="-1.898575"
|
||||
|
||||
# Get current time in the format hh:mm
|
||||
current_time=$(date +%H:%M)
|
||||
LATITUDE="53.43N"
|
||||
LONGITUDE="-1.89E"
|
||||
|
||||
# Calculate the sunrise and sunset times for today using sunwait
|
||||
light=$(sunwait poll)
|
||||
light=$(sunwait poll $LATITUDE &LONGITUDE)
|
||||
echo $sunrise_time
|
||||
echo $sunset_time
|
||||
|
||||
if [[ "$current_time" > "$sunrise_time" && "$current_time" < "$sunset_time" ]]; then
|
||||
if [[ "$light" == "DAY" ]]; then
|
||||
echo "It's daylight. Running daytime command..."
|
||||
else
|
||||
echo "It's night. Running nighttime command..."
|
||||
|
Loading…
x
Reference in New Issue
Block a user