From e2de55ac7a1ba284b4feef0c31c03eab20f93728 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 30 Jun 2025 10:38:29 +0200 Subject: [PATCH] test --- misc/build.func | 154 ++++++++++++++++++++++++------------------------ misc/core.func | 2 +- 2 files changed, 78 insertions(+), 78 deletions(-) diff --git a/misc/build.func b/misc/build.func index f6f8e582..7013e073 100644 --- a/misc/build.func +++ b/misc/build.func @@ -186,92 +186,92 @@ ssh_check() { fi } -select_storage() { - local CLASS=$1 CONTENT CONTENT_LABEL - case $CLASS in - container) - CONTENT='rootdir' - CONTENT_LABEL='Container' - ;; - template) - CONTENT='vztmpl' - CONTENT_LABEL='Template' - ;; - iso) - CONTENT='iso' - CONTENT_LABEL='ISO image' - ;; - images) - CONTENT='images' - CONTENT_LABEL='VM Disk image' - ;; - backup) - CONTENT='backup' - CONTENT_LABEL='Backup' - ;; - snippets) - CONTENT='snippets' - CONTENT_LABEL='Snippets' - ;; - *) - msg_error "Invalid storage class '$CLASS'." - exit 201 - ;; - esac +# select_storage() { +# local CLASS=$1 CONTENT CONTENT_LABEL +# case $CLASS in +# container) +# CONTENT='rootdir' +# CONTENT_LABEL='Container' +# ;; +# template) +# CONTENT='vztmpl' +# CONTENT_LABEL='Template' +# ;; +# iso) +# CONTENT='iso' +# CONTENT_LABEL='ISO image' +# ;; +# images) +# CONTENT='images' +# CONTENT_LABEL='VM Disk image' +# ;; +# backup) +# CONTENT='backup' +# CONTENT_LABEL='Backup' +# ;; +# snippets) +# CONTENT='snippets' +# CONTENT_LABEL='Snippets' +# ;; +# *) +# msg_error "Invalid storage class '$CLASS'." +# exit 201 +# ;; +# esac - command -v whiptail >/dev/null || { - msg_error "whiptail missing." - exit 220 - } - command -v numfmt >/dev/null || { - msg_error "numfmt missing." - exit 221 - } +# command -v whiptail >/dev/null || { +# msg_error "whiptail missing." +# exit 220 +# } +# command -v numfmt >/dev/null || { +# msg_error "numfmt missing." +# exit 221 +# } - local -a MENU - while read -r line; do - local TAG=$(echo "$line" | awk '{print $1}') - local TYPE=$(echo "$line" | awk '{printf "%-10s", $2}') - local FREE=$(echo "$line" | numfmt --field 4-6 --from-unit=K --to=iec --format %.2f | awk '{printf "%9sB", $6}') - MENU+=("$TAG" "Type: $TYPE Free: $FREE" "OFF") - done < <(pvesm status -content "$CONTENT" | awk 'NR>1') +# local -a MENU +# while read -r line; do +# local TAG=$(echo "$line" | awk '{print $1}') +# local TYPE=$(echo "$line" | awk '{printf "%-10s", $2}') +# local FREE=$(echo "$line" | numfmt --field 4-6 --from-unit=K --to=iec --format %.2f | awk '{printf "%9sB", $6}') +# MENU+=("$TAG" "Type: $TYPE Free: $FREE" "OFF") +# done < <(pvesm status -content "$CONTENT" | awk 'NR>1') - if [ ${#MENU[@]} -eq 0 ]; then - msg_error "No storage found for content type '$CONTENT'." - exit 203 - fi +# if [ ${#MENU[@]} -eq 0 ]; then +# msg_error "No storage found for content type '$CONTENT'." +# exit 203 +# fi - if [ $((${#MENU[@]} / 3)) -eq 1 ]; then - echo "${MENU[0]}" - return - fi +# if [ $((${#MENU[@]} / 3)) -eq 1 ]; then +# echo "${MENU[0]}" +# return +# fi - local STORAGE - STORAGE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Storage Pools" --radiolist \ - "Which storage pool for ${CONTENT_LABEL,,}?\n(Spacebar to select)" \ - 16 70 6 "${MENU[@]}" 3>&1 1>&2 2>&3) || { - msg_error "Storage selection cancelled by user." - exit 202 - } - echo "$STORAGE" -} +# local STORAGE +# STORAGE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Storage Pools" --radiolist \ +# "Which storage pool for ${CONTENT_LABEL,,}?\n(Spacebar to select)" \ +# 16 70 6 "${MENU[@]}" 3>&1 1>&2 2>&3) || { +# msg_error "Storage selection cancelled by user." +# exit 202 +# } +# echo "$STORAGE" +# } -manage_default_storage() { - local file="/usr/local/community-scripts/default_storage" - mkdir -p /usr/local/community-scripts +# manage_default_storage() { +# local file="/usr/local/community-scripts/default_storage" +# mkdir -p /usr/local/community-scripts - local tmpl=$(select_storage template) - local cont=$(select_storage container) +# local tmpl=$(select_storage template) +# local cont=$(select_storage container) - cat <"$file" -TEMPLATE_STORAGE=$tmpl -CONTAINER_STORAGE=$cont -EOF +# cat <"$file" +# TEMPLATE_STORAGE=$tmpl +# CONTAINER_STORAGE=$cont +# EOF - msg_ok "Default Storage set: Template=${BL}$tmpl${CL} ${GN}|${CL} Container=${BL}$cont${CL}" - whiptail --backtitle "[dev] Proxmox VE Helper Scripts" \ - --msgbox "Default Storage set:\n\nTemplate: $tmpl\nContainer: $cont" 10 58 -} +# msg_ok "Default Storage set: Template=${BL}$tmpl${CL} ${GN}|${CL} Container=${BL}$cont${CL}" +# whiptail --backtitle "[dev] Proxmox VE Helper Scripts" \ +# --msgbox "Default Storage set:\n\nTemplate: $tmpl\nContainer: $cont" 10 58 +# } base_settings() { # Default Settings diff --git a/misc/core.func b/misc/core.func index 63395c76..01101ae3 100644 --- a/misc/core.func +++ b/misc/core.func @@ -450,7 +450,7 @@ spinner() { msg_info() { local msg="$1" echo -ne " ${HOLD:-} ${YW}${msg} " - spinner + spinner & SPINNER_PID=$! echo "$SPINNER_PID" >/tmp/.spinner.pid }