this script has been moved to its own github repo and can now be found on https://github.com/koter84/HomeAssistant_Blueprints_Update/
Last active
January 27, 2023 14:38
-
-
Save koter84/86790850aa63354bda56d041de31dc70 to your computer and use it in GitHub Desktop.
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 | |
self_file="$0" | |
self_source_url="https://raw.githubusercontent.com/koter84/HomeAssistant_Blueprints_Update/main/blueprints_update.sh" | |
# print info function | |
function _blueprint_update_info | |
{ | |
echo "$@" | |
} | |
# create a temp file for downloading | |
_tempfile=$(mktemp -t blueprints_update.XXXXXX) | |
# start message | |
_blueprint_update_info "> ${self_file}" | |
# update | |
wget -q -O "${_tempfile}" "${self_source_url}" | |
wget_result=$? | |
if [ "${wget_result}" != "0" ] | |
then | |
_blueprint_update_info "! something went wrong while downloading, exiting..." | |
_blueprint_update_info | |
exit | |
fi | |
self_diff=$(diff "${self_file}" "${_tempfile}") | |
if [ "${self_diff}" == "" ] | |
then | |
_blueprint_update_info "-> self up-2-date" | |
else | |
cp "${_tempfile}" "${self_file}" | |
chmod +x "${self_file}" | |
_blueprint_update_info "-! self updated!" | |
exit | |
fi | |
_blueprint_update_info |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i have made a full github repository for this script, which you can find on https://github.com/koter84/HomeAssistant_Blueprints_Update/
i'm currently fixing some errors and adding a couple of features, once i commit that to the new repository i'll update this script to auto-update to that repository.