-
-
Notifications
You must be signed in to change notification settings - Fork 97
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great with a minor adjustment requested for usability.
EOF | ||
|
||
if [[ $? == 1 ]]; then | ||
echo "Stopping upgrade" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit more descriptive error message and this is good to merge
|
||
versiongit=$(curl -s -X GET https://api.github.com/repos/home-assistant/home-assistant/releases/latest | jsonValue tag_name 1|sed -e 's/^[[:space:]]*//') | ||
|
||
sudo -u homeassistant -H /bin/bash << EOF | grep Version|awk '{print $2'}|while read version; do if [[ ${versiongit} == ${version} ]]; then echo "You already have the latest version: $version";exit 1;fi;done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line has the more descriptive error message, but since its in the pipe of the EOF i did it here otherwise you loose the string value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and tagged for 0.7.
Added a so that it skips upgrading if the version is already installed. If you want to be on the edge you can now crontab the upgrade or similar. Perhaps there is a better way, but this one seemed ok. Don't really need that json function but it might be handy for other stuff too.