This commit is contained in:
CanbiZ 2025-05-07 14:09:02 +02:00
parent 76dae9237f
commit 7bba58841d
4 changed files with 0 additions and 377 deletions

View File

@ -19,27 +19,6 @@ elif command -v wget >/dev/null 2>&1; then
echo "(create-lxc.sh) Loaded core.func via wget"
fi
# This function sets color variables for formatting output in the terminal
# Colors
# YW=$(echo "\033[33m")
# YWB=$(echo "\033[93m")
# BL=$(echo "\033[36m")
# RD=$(echo "\033[01;31m")
# GN=$(echo "\033[1;92m")
# # Formatting
# CL=$(echo "\033[m")
# UL=$(echo "\033[4m")
# BOLD=$(echo "\033[1m")
# BFR="\\r\\033[K"
# HOLD=" "
# TAB=" "
# # Icons
# CM="${TAB}✔️${TAB}${CL}"
# CROSS="${TAB}✖️${TAB}${CL}"
# INFO="${TAB}💡${TAB}${CL}"
# This sets error handling options and defines the error_handler function to handle errors
set -Eeuo pipefail
trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
@ -56,53 +35,6 @@ function error_handler() {
exit 200
}
# # This function displays a spinner.
# function spinner() {
# local frames=('⠋' '⠙' '⠹' '⠸' '⠼' '⠴' '⠦' '⠧' '⠇' '⠏')
# local spin_i=0
# local interval=0.1
# printf "\e[?25l"
# local color="${YWB}"
# while true; do
# printf "\r ${color}%s${CL}" "${frames[spin_i]}"
# spin_i=$(((spin_i + 1) % ${#frames[@]}))
# sleep "$interval"
# done
# }
# # This function displays an informational message with a yellow color.
# function msg_info() {
# local msg="$1"
# echo -ne "${TAB}${YW}${HOLD}${msg}${HOLD}"
# spinner &
# SPINNER_PID=$!
# }
# function msg_warn() {
# if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID >/dev/null; then kill $SPINNER_PID >/dev/null; fi
# printf "\e[?25h"
# local msg="$1"
# echo -e "${BFR}${INFO}${YWB}${msg}${CL}"
# }
# # This function displays a success message with a green color.
# function msg_ok() {
# if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID >/dev/null; then kill $SPINNER_PID >/dev/null; fi
# printf "\e[?25h"
# local msg="$1"
# echo -e "${BFR}${CM}${GN}${msg}${CL}"
# }
# # This function displays a error message with a red color.
# function msg_error() {
# if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID >/dev/null; then kill $SPINNER_PID >/dev/null; fi
# printf "\e[?25h"
# local msg="$1"
# echo -e "${BFR}${CROSS}${RD}${msg}${CL}"
# }
# This checks for the presence of valid Container Storage and Template Storage locations
msg_info "Validating Storage"
VALIDCT=$(pvesm status -content rootdir | awk 'NR>1')

View File

@ -14,38 +14,6 @@ elif command -v wget >/dev/null 2>&1; then
echo "(alpine-install.func) Loaded core.func via wget"
fi
# This function sets color variables for formatting output in the terminal
# color() {
# # Colors
# YW=$(echo "\033[33m")
# YWB=$(echo "\033[93m")
# BL=$(echo "\033[36m")
# RD=$(echo "\033[01;31m")
# GN=$(echo "\033[1;92m")
# # Formatting
# CL=$(echo "\033[m")
# BFR="\\r\\033[K"
# BOLD=$(echo "\033[1m")
# TAB=" "
# # System
# RETRY_NUM=10
# RETRY_EVERY=3
# i=$RETRY_NUM
# # Icons
# CM="${TAB}✔️${TAB}${CL}"
# CROSS="${TAB}✖️${TAB}${CL}"
# INFO="${TAB}💡${TAB}${CL}"
# NETWORK="${TAB}📡${TAB}${CL}"
# OS="${TAB}🖥️${TAB}${CL}"
# OSVERSION="${TAB}🌟${TAB}${CL}"
# HOSTNAME="${TAB}🏠${TAB}${CL}"
# GATEWAY="${TAB}🌐${TAB}${CL}"
# DEFAULT="${TAB}⚙️${TAB}${CL}"
# }
# Function to set STD mode based on verbosity
set_std_mode() {
if [ "$VERBOSE" = "yes" ]; then
@ -88,79 +56,6 @@ error_handler() {
[[ -n "${SPINNER_PID:-}" ]] && kill "$SPINNER_PID" &>/dev/null || true
}
# # This function displays an informational message with logging support.
# declare -A MSG_INFO_SHOWN
# SPINNER_ACTIVE=0
# SPINNER_PID=""
# SPINNER_MSG=""
# trap 'stop_spinner' EXIT INT TERM HUP
# start_spinner() {
# local msg="$1"
# local frames=(⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏)
# local spin_i=0
# local interval=0.1
# SPINNER_MSG="$msg"
# printf "\r\e[2K" >&2
# {
# while [[ "$SPINNER_ACTIVE" -eq 1 ]]; do
# printf "\r\e[2K%s %b" "${frames[spin_i]}" "${YW}${SPINNER_MSG}${CL}" >&2
# spin_i=$(((spin_i + 1) % ${#frames[@]}))
# sleep "$interval"
# done
# } &
# SPINNER_PID=$!
# disown "$SPINNER_PID"
# }
# stop_spinner() {
# if [[ ${SPINNER_PID+v} && -n "$SPINNER_PID" ]] && kill -0 "$SPINNER_PID" 2>/dev/null; then
# kill "$SPINNER_PID" 2>/dev/null
# sleep 0.1
# kill -0 "$SPINNER_PID" 2>/dev/null && kill -9 "$SPINNER_PID" 2>/dev/null
# wait "$SPINNER_PID" 2>/dev/null || true
# fi
# SPINNER_ACTIVE=0
# unset SPINNER_PID
# }
# spinner_guard() {
# if [[ "$SPINNER_ACTIVE" -eq 1 ]] && [[ -n "$SPINNER_PID" ]]; then
# kill "$SPINNER_PID" 2>/dev/null
# wait "$SPINNER_PID" 2>/dev/null || true
# SPINNER_ACTIVE=0
# unset SPINNER_PID
# fi
# }
# msg_info() {
# local msg="$1"
# [[ -n "${MSG_INFO_SHOWN["$msg"]+x}" ]] && return
# MSG_INFO_SHOWN["$msg"]=1
# spinner_guard
# SPINNER_ACTIVE=1
# start_spinner "$msg"
# }
# msg_ok() {
# local msg="$1"
# stop_spinner
# printf "\r\e[2K%s %b\n" "${CM}" "${GN}${msg}${CL}" >&2
# unset MSG_INFO_SHOWN["$msg"]
# }
# msg_error() {
# stop_spinner
# local msg="$1"
# printf "\r\e[2K%s %b\n" "${CROSS}" "${RD}${msg}${CL}" >&2
# #log_message "ERROR" "$msg"
# }
# This function sets up the Container OS by generating the locale, setting the timezone, and checking the network connection
setting_up_container() {
msg_info "Setting up Container OS"

View File

@ -26,50 +26,6 @@ elif command -v wget >/dev/null 2>&1; then
echo "(build.func) Loaded core.func via wget"
fi
# # This function sets various color variables using ANSI escape codes for formatting text in the terminal.
# color() {
# # Colors
# YW=$(echo "\033[33m")
# YWB=$(echo "\033[93m")
# BL=$(echo "\033[36m")
# RD=$(echo "\033[01;31m")
# BGN=$(echo "\033[4;92m")
# GN=$(echo "\033[1;92m")
# DGN=$(echo "\033[32m")
# # Formatting
# CL=$(echo "\033[m")
# BOLD=$(echo "\033[1m")
# HOLD=" "
# TAB=" "
# # Icons
# CM="${TAB}✔️${TAB}"
# CROSS="${TAB}✖️${TAB}"
# INFO="${TAB}💡${TAB}${CL}"
# OS="${TAB}🖥️${TAB}${CL}"
# OSVERSION="${TAB}🌟${TAB}${CL}"
# CONTAINERTYPE="${TAB}📦${TAB}${CL}"
# DISKSIZE="${TAB}💾${TAB}${CL}"
# CPUCORE="${TAB}🧠${TAB}${CL}"
# RAMSIZE="${TAB}🛠️${TAB}${CL}"
# SEARCH="${TAB}🔍${TAB}${CL}"
# VERBOSE_CROPPED="🔍${TAB}"
# VERIFYPW="${TAB}🔐${TAB}${CL}"
# CONTAINERID="${TAB}🆔${TAB}${CL}"
# HOSTNAME="${TAB}🏠${TAB}${CL}"
# BRIDGE="${TAB}🌉${TAB}${CL}"
# NETWORK="${TAB}📡${TAB}${CL}"
# GATEWAY="${TAB}🌐${TAB}${CL}"
# DISABLEIPV6="${TAB}🚫${TAB}${CL}"
# DEFAULT="${TAB}⚙️${TAB}${CL}"
# MACADDRESS="${TAB}🔗${TAB}${CL}"
# VLANTAG="${TAB}🏷️${TAB}${CL}"
# ROOTSSH="${TAB}🔑${TAB}${CL}"
# CREATING="${TAB}🚀${TAB}${CL}"
# ADVANCED="${TAB}🧩${TAB}${CL}"
# }
# This function enables error handling in the script by setting options and defining a trap for the ERR signal.
catch_errors() {
set -Eeuo pipefail
@ -88,95 +44,6 @@ error_handler() {
post_update_to_api "failed" "${command}"
echo -e "\n$error_message\n"
}
# # This function displays an informational message with logging support.
# declare -A MSG_INFO_SHOWN
# SPINNER_ACTIVE=0
# SPINNER_PID=""
# SPINNER_MSG=""
# trap 'stop_spinner' EXIT INT TERM HUP
# start_spinner() {
# local msg="$1"
# local frames=(⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏)
# local spin_i=0
# local interval=0.1
# SPINNER_MSG="$msg"
# printf "\r\e[2K" >&2
# {
# while [[ "$SPINNER_ACTIVE" -eq 1 ]]; do
# printf "\r\e[2K%s %b" "${frames[spin_i]}" "${YW}${SPINNER_MSG}${CL}" >&2
# spin_i=$(((spin_i + 1) % ${#frames[@]}))
# sleep "$interval"
# done
# } &
# SPINNER_PID=$!
# disown "$SPINNER_PID"
# }
# stop_spinner() {
# if [[ ${SPINNER_PID+v} && -n "$SPINNER_PID" ]] && kill -0 "$SPINNER_PID" 2>/dev/null; then
# kill "$SPINNER_PID" 2>/dev/null
# sleep 0.1
# kill -0 "$SPINNER_PID" 2>/dev/null && kill -9 "$SPINNER_PID" 2>/dev/null
# wait "$SPINNER_PID" 2>/dev/null || true
# fi
# SPINNER_ACTIVE=0
# unset SPINNER_PID
# }
# spinner_guard() {
# if [[ "$SPINNER_ACTIVE" -eq 1 ]] && [[ -n "$SPINNER_PID" ]]; then
# kill "$SPINNER_PID" 2>/dev/null
# wait "$SPINNER_PID" 2>/dev/null || true
# SPINNER_ACTIVE=0
# unset SPINNER_PID
# fi
# }
# msg_info() {
# local msg="$1"
# [[ -n "${MSG_INFO_SHOWN["$msg"]+x}" ]] && return
# MSG_INFO_SHOWN["$msg"]=1
# spinner_guard
# SPINNER_ACTIVE=1
# start_spinner "$msg"
# }
# msg_ok() {
# local msg="$1"
# stop_spinner
# printf "\r\e[2K%s %b\n" "${CM}" "${GN}${msg}${CL}" >&2
# unset MSG_INFO_SHOWN["$msg"]
# }
# msg_error() {
# stop_spinner
# local msg="$1"
# printf "\r\e[2K%s %b\n" "${CROSS}" "${RD}${msg}${CL}" >&2
# #log_message "ERROR" "$msg"
# }
# log_message() {
# local level="$1"
# local message="$2"
# local timestamp
# local logdate
# timestamp=$(date '+%Y-%m-%d %H:%M:%S')
# logdate=$(date '+%Y-%m-%d')
# LOGDIR="/usr/local/community-scripts/logs"
# mkdir -p "$LOGDIR"
# LOGFILE="${LOGDIR}/${logdate}_${NSAPP}.log"
# echo "$timestamp - $level: $message" >>"$LOGFILE"
# }
# Check if the shell is using bash
shell_check() {
if [[ "$(basename "$SHELL")" != "bash" ]]; then

View File

@ -15,37 +15,6 @@ elif command -v wget >/dev/null 2>&1; then
echo "(install.func) Loaded core.func via wget"
fi
# color() {
# # Colors
# YW=$(echo "\033[33m")
# YWB=$(echo "\033[93m")
# BL=$(echo "\033[36m")
# RD=$(echo "\033[01;31m")
# GN=$(echo "\033[1;92m")
# # Formatting
# CL=$(echo "\033[m")
# BFR="\\r\\033[K"
# BOLD=$(echo "\033[1m")
# HOLD=" "
# TAB=" "
# # System
# RETRY_NUM=10
# RETRY_EVERY=3
# # Icons
# CM="${TAB}✔️${TAB}${CL}"
# CROSS="${TAB}✖️${TAB}${CL}"
# INFO="${TAB}💡${TAB}${CL}"
# NETWORK="${TAB}📡${TAB}${CL}"
# OS="${TAB}🖥️${TAB}${CL}"
# OSVERSION="${TAB}🌟${TAB}${CL}"
# HOSTNAME="${TAB}🏠${TAB}${CL}"
# GATEWAY="${TAB}🌐${TAB}${CL}"
# DEFAULT="${TAB}⚙️${TAB}${CL}"
# }
# Function to set STD mode based on verbosity
set_std_mode() {
if [ "$VERBOSE" = "yes" ]; then
@ -96,46 +65,6 @@ error_handler() {
fi
}
# # This function displays a spinner.
# spinner() {
# local frames=('⠋' '⠙' '⠹' '⠸' '⠼' '⠴' '⠦' '⠧' '⠇' '⠏')
# local spin_i=0
# local interval=0.1
# printf "\e[?25l"
# local color="${YWB}"
# while true; do
# printf "\r ${color}%s${CL}" "${frames[spin_i]}"
# spin_i=$(((spin_i + 1) % ${#frames[@]}))
# sleep "$interval"
# done
# }
# # This function displays an informational message with a yellow color.
# msg_info() {
# local msg="$1"
# echo -ne "${TAB}${YW}${HOLD}${msg}${HOLD}"
# spinner &
# SPINNER_PID=$!
# }
# # This function displays a success message with a green color.
# msg_ok() {
# if [ -n "$SPINNER_PID" ] && ps -p "$SPINNER_PID" >/dev/null; then kill "$SPINNER_PID" >/dev/null; fi
# printf "\e[?25h"
# local msg="$1"
# echo -e "${BFR}${CM}${GN}${msg}${CL}"
# }
# # This function displays a error message with a red color.
# msg_error() {
# if [ -n "$SPINNER_PID" ] && ps -p "$SPINNER_PID" >/dev/null; then kill "$SPINNER_PID" >/dev/null; fi
# printf "\e[?25h"
# local msg="$1"
# echo -e "${BFR}${CROSS}${RD}${msg}${CL}"
# }
# This function sets up the Container OS by generating the locale, setting the timezone, and checking the network connection
setting_up_container() {
msg_info "Setting up Container OS"