From 636beae720773f238c257e4b57136a338890e78d Mon Sep 17 00:00:00 2001 From: nicedevil007 <17103076+nicedevil007@users.noreply.github.com> Date: Wed, 22 Mar 2023 21:32:44 +0100 Subject: [PATCH] New Menu same as on grafana --- ct/alpine-adguard.sh | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/ct/alpine-adguard.sh b/ct/alpine-adguard.sh index 3b7af3bc..b84f2025 100644 --- a/ct/alpine-adguard.sh +++ b/ct/alpine-adguard.sh @@ -52,22 +52,30 @@ function default_settings() { } function update_script() { - UPD=$(whiptail --title "SUPPORT" --radiolist --cancel-button Exit-Script "Spacebar = Select" 11 58 2 \ - "1" "Update LXC OS" ON \ - "2" "Manually Update $APP" OFF \ - 3>&1 1>&2 2>&3) - - header_info - if [ "$UPD" == "1" ]; then - apk update && apk upgrade - exit - fi - - if [ "$UPD" == "2" ]; then - header_info - echo "In the process of creating a method to update" - exit +LXCIP=$(ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1) +while true; do + CHOICE=$(whiptail --title "SUPPORT" --menu "Select option" 11 58 2 \ + "1" "Update LXC OS" \ + "2" "Manually Update $APP" 3>&2 2>&1 1>&3 + ) + exit_status=$? + if [ $exit_status == 1 ] ; then + clear + exit-script fi + header_info + case $CHOICE in + 1 ) + apk update && apk upgrade + exit + ;; + 2 ) + header_info + echo "In the process of creating a method to update" + exit + ;; + esac +done } start