script: use whiptail for kiauh_update_dialogue

This commit is contained in:
Yifei Ding
2021-11-09 12:43:59 -08:00
parent ab81cf500d
commit 0b737e46b4
2 changed files with 16 additions and 24 deletions

View File

@@ -41,18 +41,6 @@ print_header(){
bottom_border bottom_border
} }
kiauh_update_msg(){
top_border
echo -e "|${green} New KIAUH update available! ${default}| "
hr
echo -e "|${green} View Changelog: https://git.io/JnmlX ${default}| "
blank_line
echo -e "|${yellow} It is recommended to keep KIAUH up to date. Updates ${default}| "
echo -e "|${yellow} usually contain bugfixes, important changes or new ${default}| "
echo -e "|${yellow} features. Please consider updating! ${default}| "
bottom_border
}
################################################################################ ################################################################################
#******************************************************************************# #******************************************************************************#
################################################################################ ################################################################################

View File

@@ -25,18 +25,22 @@ print_kiauh_version(){
} }
kiauh_update_dialog(){ kiauh_update_dialog(){
kiauh_update_msg whiptail --title "New KIAUH update available!"\
read -p "${cyan}Do you want to update now? (Y/n):${default} " yn --yesno \
while true; do "View Changelog: https://git.io/JnmlX
case "$yn" in
Y|y|Yes|yes|"") It is recommended to keep KIAUH up to date. Updates usually contain bugfixes, \
do_action "update_kiauh" important changes or new features. Please consider updating!
break;;
N|n|No|no) break;; Do you want to update now?" \
*) $KIAUH_WHIPTAIL_NORMAL_HEIGHT $KIAUH_WHIPTAIL_NORMAL_WIDTH
deny_action "kiauh_update_dialog";;
esac RET=$?
done if [ $RET -eq 0 ]; then
do_action "update_kiauh"
else
deny_action "kiauh_update_dialog"
fi
} }
main_menu(){ main_menu(){