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