Update build.func

This commit is contained in:
CanbiZ 2024-12-18 10:21:29 +01:00 committed by GitHub
parent fbb1b7d88a
commit b6104103cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -158,8 +158,19 @@ arch_check() {
# This function sets the APP-Name into an ASCII Header in Slant, figlet needed on proxmox main node.
header_info() {
apt-get install -y figlet &> /dev/null
ascii_art=$(figlet -f slant "$APP")
if [ -f /etc/debian_version ]; then
# Debian/Ubuntu
apt-get install -y figlet &> /dev/null
elif [ -f /etc/alpine-release ]; then
# Alpine Linux
apk add --no-cache figlet &> /dev/null
else
echo "Unsupported OS"
return 1
fi
term_width=$(tput cols)
ascii_art=$(figlet -f slant -w "$term_width" "$APP")
clear
cat <<EOF
$ascii_art
@ -204,7 +215,7 @@ base_settings() {
TAGS="community-script;"
# Override default settings with variables from ct script
CT_TYPE=${var_privileged:-$CT_TYPE}
CT_TYPE=${var_unprivileged:-$CT_TYPE}
DISK_SIZE=${var_disk:-$DISK_SIZE}
CORE_COUNT=${var_cpu:-$CORE_COUNT}
RAM_SIZE=${var_ram:-$RAM_SIZE}
@ -611,7 +622,7 @@ install_script() {
;;
2)
header_info
echo -e "${DEFAULT}${BOLD}${BL}Using Default Settings (${SEARCH} Verbose)${CL}"
echo -e "${DEFAULT}${BOLD}${BL}Using Default Settings (${SEARCH}${BOLD}${BL} Verbose)${CL}"
VERB="yes"
base_settings "$VERB"
echo_default
@ -703,20 +714,13 @@ build_container() {
FEATURES="nesting=1"
fi
# This function enables verbose
verb() {
if [ "$VERBOSE" = "yes" ]; then
STD=""
else STD="silent"; fi
silent() { "$@" >/dev/null 2>&1; }
}
TEMP_DIR=$(mktemp -d)
pushd $TEMP_DIR >/dev/null
if [ "$var_os" == "alpine" ]; then
export FUNCTIONS_FILE_PATH="$(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/alpine-install.func)"
export FUNCTIONS_FILE_PATH="$(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/develop/misc/alpine-install.func)"
else
export FUNCTIONS_FILE_PATH="$(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/install.func)"
export FUNCTIONS_FILE_PATH="$(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/develop/misc/install.func)"
fi
export CACHER="$APT_CACHER"
export CACHER_IP="$APT_CACHER_IP"
@ -746,7 +750,7 @@ verb() {
$PW
"
# This executes create_lxc.sh and creates the container and .conf file
bash -c "$(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/create_lxc.sh)" || exit
bash -c "$(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/develop/ct/create_lxc.sh)" || exit
LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
if [ "$CT_TYPE" == "0" ]; then
@ -808,7 +812,7 @@ http://dl-cdn.alpinelinux.org/alpine/latest-stable/community
EOF'
pct exec "$CTID" -- ash -c "apk add bash >/dev/null"
fi
lxc-attach -n "$CTID" -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/install/$var_install.sh)" || exit
lxc-attach -n "$CTID" -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/develop/install/$var_install.sh)" || exit
}
@ -820,7 +824,7 @@ description() {
DESCRIPTION=$(cat <<EOF
<div align='center'>
<a href='https://Helper-Scripts.com' target='_blank' rel='noopener noreferrer'>
<img src='https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/images/logo-81x112.png' alt='Logo' style='width:81px;height:112px;'/>
<img src='https://raw.githubusercontent.com/community-scripts/ProxmoxVE/develop/misc/images/logo-81x112.png' alt='Logo' style='width:81px;height:112px;'/>
</a>
<h2 style='font-size: 24px; margin: 20px 0;'>${APP} LXC</h2>
@ -853,4 +857,4 @@ EOF
if [[ -f /etc/systemd/system/ping-instances.service ]]; then
systemctl start ping-instances.service
fi
}
}