simple startup update check for KIAUH

This commit is contained in:
th33xitus
2020-07-25 20:57:32 +02:00
parent d84a740f0d
commit 22888f5756
4 changed files with 40 additions and 1 deletions

View File

@@ -1,3 +1,16 @@
kiauh_status(){
cd ${HOME}/kiauh
#get local state
LOCAL_KIAUH_COMMIT=$(git rev-parse --short=8 HEAD)
#REMOTE_KIAUH_COMMIT=$(git rev-parse --short=8 origin/master)
REMOTE_KIAUH_COMMIT=$(git rev-parse --short=8 dev-2.0)
if [ "$LOCAL_KIAUH_COMMIT" != "$REMOTE_KIAUH_COMMIT" ]; then
KIAUH_UPDATE_AVAIL=1
else
KIAUH_UPDATE_AVAIL=0
fi
}
klipper_status(){
kcount=0
klipper_data=(

View File

@@ -154,4 +154,11 @@ switch_ui(){
echo -e "| 4) [--> moonraker] | "
echo -e "| 5) [--> dev-moonraker] | "
quit_footer
}
kiauh_update_msg(){
top_border
echo -e "| ${yellow}There is a newer version of this script available!${default} | "
echo -e "| ${yellow}Type 'update' if you want to update KIAUH now.${default} | "
bottom_border
}

View File

@@ -6,6 +6,14 @@ update_check(){
read_remote_commit
}
update_kiauh(){
if [ $KIAUH_UPDATE_AVAIL = 1 ]; then
status_msg "Updating KIAUH ..."
cd ${HOME}/kiauh
git pull && ok_msg "Update complete! Please restart KIAUH."; echo
fi
}
update_klipper(){
stop_klipper
bb4u "klipper"