2024-12-12 15:50 : id 405
This commit is contained in:
parent
64c009f5e0
commit
f277bd4f03
@ -128,18 +128,13 @@ in
|
||||
# Calculate the sunrise and sunset times for today using sunwait
|
||||
sunrise_time=$(sunwait rise $LATITUDE $LONGITUDE | awk '{print $2}')
|
||||
sunset_time=$(sunwait set $LATITUDE $LONGITUDE | awk '{print $2}')
|
||||
echo $sunrise_time
|
||||
echo $sunset_time
|
||||
|
||||
# Compare current time with sunrise and sunset times
|
||||
if [[ "$current_time" > "$sunrise_time" && "$current_time" < "$sunset_time" ]]; then
|
||||
# It's daylight, run the "daytime" command
|
||||
echo "It's daylight. Running daytime command..."
|
||||
# Replace the following line with the command you want to run during the day
|
||||
/path/to/daytime_command
|
||||
else
|
||||
# It's night, run the "nighttime" command
|
||||
echo "It's night. Running nighttime command..."
|
||||
# Replace the following line with the command you want to run during the night
|
||||
/path/to/nighttime_command
|
||||
fi
|
||||
'';
|
||||
executable = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user