mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-04-24 05:28:06 +00:00
Update build.func
This commit is contained in:
parent
fbb1b7d88a
commit
b6104103cb
@ -158,8 +158,19 @@ arch_check() {
|
|||||||
|
|
||||||
# This function sets the APP-Name into an ASCII Header in Slant, figlet needed on proxmox main node.
|
# This function sets the APP-Name into an ASCII Header in Slant, figlet needed on proxmox main node.
|
||||||
header_info() {
|
header_info() {
|
||||||
|
if [ -f /etc/debian_version ]; then
|
||||||
|
# Debian/Ubuntu
|
||||||
apt-get install -y figlet &> /dev/null
|
apt-get install -y figlet &> /dev/null
|
||||||
ascii_art=$(figlet -f slant "$APP")
|
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
|
clear
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
$ascii_art
|
$ascii_art
|
||||||
@ -204,7 +215,7 @@ base_settings() {
|
|||||||
TAGS="community-script;"
|
TAGS="community-script;"
|
||||||
|
|
||||||
# Override default settings with variables from ct 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}
|
DISK_SIZE=${var_disk:-$DISK_SIZE}
|
||||||
CORE_COUNT=${var_cpu:-$CORE_COUNT}
|
CORE_COUNT=${var_cpu:-$CORE_COUNT}
|
||||||
RAM_SIZE=${var_ram:-$RAM_SIZE}
|
RAM_SIZE=${var_ram:-$RAM_SIZE}
|
||||||
@ -611,7 +622,7 @@ install_script() {
|
|||||||
;;
|
;;
|
||||||
2)
|
2)
|
||||||
header_info
|
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"
|
VERB="yes"
|
||||||
base_settings "$VERB"
|
base_settings "$VERB"
|
||||||
echo_default
|
echo_default
|
||||||
@ -703,20 +714,13 @@ build_container() {
|
|||||||
FEATURES="nesting=1"
|
FEATURES="nesting=1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# This function enables verbose
|
|
||||||
verb() {
|
|
||||||
if [ "$VERBOSE" = "yes" ]; then
|
|
||||||
STD=""
|
|
||||||
else STD="silent"; fi
|
|
||||||
silent() { "$@" >/dev/null 2>&1; }
|
|
||||||
}
|
|
||||||
|
|
||||||
TEMP_DIR=$(mktemp -d)
|
TEMP_DIR=$(mktemp -d)
|
||||||
pushd $TEMP_DIR >/dev/null
|
pushd $TEMP_DIR >/dev/null
|
||||||
if [ "$var_os" == "alpine" ]; then
|
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
|
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
|
fi
|
||||||
export CACHER="$APT_CACHER"
|
export CACHER="$APT_CACHER"
|
||||||
export CACHER_IP="$APT_CACHER_IP"
|
export CACHER_IP="$APT_CACHER_IP"
|
||||||
@ -746,7 +750,7 @@ verb() {
|
|||||||
$PW
|
$PW
|
||||||
"
|
"
|
||||||
# This executes create_lxc.sh and creates the container and .conf file
|
# 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
|
LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
|
||||||
if [ "$CT_TYPE" == "0" ]; then
|
if [ "$CT_TYPE" == "0" ]; then
|
||||||
@ -808,7 +812,7 @@ http://dl-cdn.alpinelinux.org/alpine/latest-stable/community
|
|||||||
EOF'
|
EOF'
|
||||||
pct exec "$CTID" -- ash -c "apk add bash >/dev/null"
|
pct exec "$CTID" -- ash -c "apk add bash >/dev/null"
|
||||||
fi
|
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
|
DESCRIPTION=$(cat <<EOF
|
||||||
<div align='center'>
|
<div align='center'>
|
||||||
<a href='https://Helper-Scripts.com' target='_blank' rel='noopener noreferrer'>
|
<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>
|
</a>
|
||||||
|
|
||||||
<h2 style='font-size: 24px; margin: 20px 0;'>${APP} LXC</h2>
|
<h2 style='font-size: 24px; margin: 20px 0;'>${APP} LXC</h2>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user