This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Get the current hour in local time | |
current_hour_local=$(date +%H) | |
# Check if the current time is before 7 AM or after 5 PM | |
if [ "$current_hour_local" -lt 7 ] || [ "$current_hour_local" -ge 17 ]; then | |
# Run cec-client and capture the power status of the TV | |
power_status=$(echo 'pow 0' | cec-client -s -d 1 | grep 'power status' | awk '{print $3}') |
OlderNewer