This file contains hidden or 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 output of ha su info | |
info_output=$(ha core info) | |
# Parse the output and extract values | |
update_available=$(echo "$info_output" | grep -Eo 'update_available: (true|false)') | |
version_latest=$(echo "$info_output" | grep -Eo 'version_latest: .*' | cut -d ' ' -f2) | |
# Check if update is available |