2024-12-12 16:11 : id 407

This commit is contained in:
deadvey 2024-12-12 16:11:47 +00:00
parent 428f2be7d8
commit 67edd7ebbc

View File

@ -119,18 +119,15 @@ in
text = '' text = ''
#!/bin/bash #!/bin/bash
# Set your latitude and longitude # Set your latitude and longitude
LATITUDE="52.489471" LATITUDE="53.43N"
LONGITUDE="-1.898575" LONGITUDE="-1.89E"
# Get current time in the format hh:mm
current_time=$(date +%H:%M)
# Calculate the sunrise and sunset times for today using sunwait # Calculate the sunrise and sunset times for today using sunwait
light=$(sunwait poll) light=$(sunwait poll $LATITUDE &LONGITUDE)
echo $sunrise_time echo $sunrise_time
echo $sunset_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..." echo "It's daylight. Running daytime command..."
else else
echo "It's night. Running nighttime command..." echo "It's night. Running nighttime command..."