mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-06-30 11:07:38 +00:00
Replace wget with curl -fsSL, normalize downloads, and prep for IPv6 (#3455)
* Initial Call, Switch from curl -s to curl -fsSL and wget to curl -fssL * more switches * switch vms * more curls * More curls * more * more * more changes * more * prepare ipv6 calls * change frontend to ipv6 * Formatting * Fromatting * Update gomft.sh * Update gomft-install.sh * Update ersatztv.sh * Update build.func --------- Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com>
This commit is contained in:
@ -4,8 +4,7 @@
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
source /dev/stdin <<< $(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func)
|
||||
|
||||
source /dev/stdin <<<$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func)
|
||||
|
||||
function header_info {
|
||||
clear
|
||||
@ -65,7 +64,7 @@ THIN="discard=on,ssd=1,"
|
||||
set -e
|
||||
trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
|
||||
trap cleanup EXIT
|
||||
trap 'post_update_to_api "failed" "INTERRUPTED"' SIGINT
|
||||
trap 'post_update_to_api "failed" "INTERRUPTED"' SIGINT
|
||||
trap 'post_update_to_api "failed" "TERMINATED"' SIGTERM
|
||||
function error_handler() {
|
||||
local exit_code="$?"
|
||||
@ -94,7 +93,7 @@ pushd $TEMP_DIR >/dev/null
|
||||
if whiptail --backtitle "Proxmox VE Helper Scripts" --title "Arch Linux VM" --yesno "This will create a New Arch Linux VM. Proceed?" 10 58; then
|
||||
:
|
||||
else
|
||||
header_info && echo -e "${CROSS}${RD}User exited script${CL}\n" && exit
|
||||
header_info && echo -e "${CROSS}${RD}User exited script${CL}\n" && exit
|
||||
fi
|
||||
|
||||
function msg_info() {
|
||||
@ -123,7 +122,7 @@ function check_root() {
|
||||
}
|
||||
|
||||
function pve_check() {
|
||||
if ! pveversion | grep -Eq "pve-manager/8\.[1-3](\.[0-9]+)*"; then
|
||||
if ! pveversion | grep -Eq "pve-manager/8\.[1-3](\.[0-9]+)*"; then
|
||||
msg_error "${CROSS}${RD}This version of Proxmox Virtual Environment is not supported"
|
||||
echo -e "Requires Proxmox Virtual Environment Version 8.1 or later."
|
||||
echo -e "Exiting..."
|
||||
@ -228,7 +227,7 @@ function advanced_settings() {
|
||||
else
|
||||
exit-script
|
||||
fi
|
||||
|
||||
|
||||
if DISK_SIZE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set Disk Size in GiB (e.g., 10, 20)" 8 58 "$DISK_SIZE" --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
|
||||
DISK_SIZE=$(echo "$DISK_SIZE" | tr -d ' ')
|
||||
if [[ "$DISK_SIZE" =~ ^[0-9]+$ ]]; then
|
||||
@ -243,7 +242,7 @@ function advanced_settings() {
|
||||
else
|
||||
exit-script
|
||||
fi
|
||||
|
||||
|
||||
if DISK_CACHE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "DISK CACHE" --radiolist "Choose" --cancel-button Exit-Script 10 58 2 \
|
||||
"0" "None (Default)" ON \
|
||||
"1" "Write Through" OFF \
|
||||
@ -425,7 +424,7 @@ msg_info "Retrieving the URL for the Arch Linux .iso File"
|
||||
URL=https://geo.mirror.pkgbuild.com/iso/latest/archlinux-x86_64.iso
|
||||
sleep 2
|
||||
msg_ok "${CL}${BL}${URL}${CL}"
|
||||
wget -q --show-progress $URL
|
||||
curl -fsSL -o "$(basename "$URL")" "$URL"
|
||||
echo -en "\e[1A\e[0K"
|
||||
FILE=$(basename $URL)
|
||||
msg_ok "Downloaded ${CL}${BL}${FILE}${CL}"
|
||||
@ -495,11 +494,11 @@ EOF
|
||||
)
|
||||
qm set "$VMID" -description "$DESCRIPTION" >/dev/null
|
||||
if [ -n "$DISK_SIZE" ]; then
|
||||
msg_info "Resizing disk to $DISK_SIZE GB"
|
||||
qm resize $VMID scsi0 ${DISK_SIZE} >/dev/null
|
||||
msg_info "Resizing disk to $DISK_SIZE GB"
|
||||
qm resize $VMID scsi0 ${DISK_SIZE} >/dev/null
|
||||
else
|
||||
msg_info "Using default disk size of $DEFAULT_DISK_SIZE GB"
|
||||
qm resize $VMID scsi0 ${DEFAULT_DISK_SIZE} >/dev/null
|
||||
msg_info "Using default disk size of $DEFAULT_DISK_SIZE GB"
|
||||
qm resize $VMID scsi0 ${DEFAULT_DISK_SIZE} >/dev/null
|
||||
fi
|
||||
|
||||
msg_ok "Created a Arch Linux VM ${CL}${BL}(${HN})"
|
||||
|
@ -4,7 +4,7 @@
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
source /dev/stdin <<< $(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func)
|
||||
source /dev/stdin <<<$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func)
|
||||
|
||||
function header_info {
|
||||
clear
|
||||
@ -63,7 +63,7 @@ THIN="discard=on,ssd=1,"
|
||||
set -e
|
||||
trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
|
||||
trap cleanup EXIT
|
||||
trap 'post_update_to_api "failed" "INTERRUPTED"' SIGINT
|
||||
trap 'post_update_to_api "failed" "INTERRUPTED"' SIGINT
|
||||
trap 'post_update_to_api "failed" "TERMINATED"' SIGTERM
|
||||
function error_handler() {
|
||||
local exit_code="$?"
|
||||
@ -93,7 +93,7 @@ pushd $TEMP_DIR >/dev/null
|
||||
if whiptail --backtitle "Proxmox VE Helper Scripts" --title "Debian 12 VM" --yesno "This will create a New Debian 12 VM. Proceed?" 10 58; then
|
||||
:
|
||||
else
|
||||
header_info && echo -e "${CROSS}${RD}User exited script${CL}\n" && exit
|
||||
header_info && echo -e "${CROSS}${RD}User exited script${CL}\n" && exit
|
||||
fi
|
||||
|
||||
function msg_info() {
|
||||
@ -122,7 +122,7 @@ function check_root() {
|
||||
}
|
||||
|
||||
function pve_check() {
|
||||
if ! pveversion | grep -Eq "pve-manager/8\.[1-3](\.[0-9]+)*"; then
|
||||
if ! pveversion | grep -Eq "pve-manager/8\.[1-3](\.[0-9]+)*"; then
|
||||
msg_error "${CROSS}${RD}This version of Proxmox Virtual Environment is not supported"
|
||||
echo -e "Requires Proxmox Virtual Environment Version 8.1 or later."
|
||||
echo -e "Exiting..."
|
||||
@ -227,7 +227,7 @@ function advanced_settings() {
|
||||
else
|
||||
exit-script
|
||||
fi
|
||||
|
||||
|
||||
if DISK_SIZE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set Disk Size in GiB (e.g., 10, 20)" 8 58 "$DISK_SIZE" --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
|
||||
DISK_SIZE=$(echo "$DISK_SIZE" | tr -d ' ')
|
||||
if [[ "$DISK_SIZE" =~ ^[0-9]+$ ]]; then
|
||||
@ -425,7 +425,7 @@ msg_info "Retrieving the URL for the Debian 12 Qcow2 Disk Image"
|
||||
URL=https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-nocloud-amd64.qcow2
|
||||
sleep 2
|
||||
msg_ok "${CL}${BL}${URL}${CL}"
|
||||
wget -q --show-progress $URL
|
||||
curl -fsSL -o "$(basename "$URL")" "$URL"
|
||||
echo -en "\e[1A\e[0K"
|
||||
FILE=$(basename $URL)
|
||||
msg_ok "Downloaded ${CL}${BL}${FILE}${CL}"
|
||||
@ -494,12 +494,12 @@ EOF
|
||||
)
|
||||
qm set "$VMID" -description "$DESCRIPTION" >/dev/null
|
||||
if [ -n "$DISK_SIZE" ]; then
|
||||
msg_info "Resizing disk to $DISK_SIZE GB"
|
||||
qm resize $VMID scsi0 ${DISK_SIZE} >/dev/null
|
||||
msg_info "Resizing disk to $DISK_SIZE GB"
|
||||
qm resize $VMID scsi0 ${DISK_SIZE} >/dev/null
|
||||
else
|
||||
msg_info "Using default disk size of $DEFAULT_DISK_SIZE GB"
|
||||
qm resize $VMID scsi0 ${DEFAULT_DISK_SIZE} >/dev/null
|
||||
fi
|
||||
msg_info "Using default disk size of $DEFAULT_DISK_SIZE GB"
|
||||
qm resize $VMID scsi0 ${DEFAULT_DISK_SIZE} >/dev/null
|
||||
fi
|
||||
|
||||
msg_ok "Created a Debian 12 VM ${CL}${BL}(${HN})"
|
||||
if [ "$START_VM" == "yes" ]; then
|
||||
|
@ -4,7 +4,7 @@
|
||||
# Author: thost96 (thost96)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
source /dev/stdin <<< $(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func)
|
||||
source /dev/stdin <<<$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func)
|
||||
|
||||
function header_info {
|
||||
clear
|
||||
@ -44,7 +44,7 @@ THIN="discard=on,ssd=1,"
|
||||
set -e
|
||||
trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
|
||||
trap cleanup EXIT
|
||||
trap 'post_update_to_api "failed" "INTERRUPTED"' SIGINT
|
||||
trap 'post_update_to_api "failed" "INTERRUPTED"' SIGINT
|
||||
trap 'post_update_to_api "failed" "TERMINATED"' SIGTERM
|
||||
function error_handler() {
|
||||
local exit_code="$?"
|
||||
@ -102,13 +102,13 @@ function check_root() {
|
||||
}
|
||||
|
||||
function pve_check() {
|
||||
if ! pveversion | grep -Eq "pve-manager/8\.[1-3](\.[0-9]+)*"; then
|
||||
if ! pveversion | grep -Eq "pve-manager/8\.[1-3](\.[0-9]+)*"; then
|
||||
msg_error "This version of Proxmox Virtual Environment is not supported"
|
||||
echo -e "Requires Proxmox Virtual Environment Version 8.1 or later."
|
||||
echo -e "Exiting..."
|
||||
sleep 2
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function arch_check() {
|
||||
@ -388,7 +388,7 @@ msg_info "Retrieving the URL for the Debian 12 Qcow2 Disk Image"
|
||||
URL="https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-nocloud-$(dpkg --print-architecture).qcow2"
|
||||
sleep 2
|
||||
msg_ok "${CL}${BL}${URL}${CL}"
|
||||
wget -q --show-progress $URL
|
||||
curl -fsSL -o "$(basename "$URL")" "$URL"
|
||||
echo -en "\e[1A\e[0K"
|
||||
FILE=$(basename $URL)
|
||||
msg_ok "Downloaded ${CL}${BL}${FILE}${CL}"
|
||||
@ -421,14 +421,13 @@ msg_ok "Installed libguestfs-tools successfully"
|
||||
|
||||
msg_info "Adding Docker and Docker Compose Plugin to Debian 12 Qcow2 Disk Image"
|
||||
virt-customize -q -a "${FILE}" --install qemu-guest-agent,apt-transport-https,ca-certificates,curl,gnupg,software-properties-common,lsb-release >/dev/null &&
|
||||
virt-customize -q -a "${FILE}" --run-command "mkdir -p /etc/apt/keyrings && curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg" >/dev/null &&
|
||||
virt-customize -q -a "${FILE}" --run-command "echo 'deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian bookworm stable' > /etc/apt/sources.list.d/docker.list" >/dev/null &&
|
||||
virt-customize -q -a "${FILE}" --run-command "apt-get update -qq && apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin" >/dev/null &&
|
||||
virt-customize -q -a "${FILE}" --run-command "systemctl enable docker" >/dev/null &&
|
||||
virt-customize -q -a "${FILE}" --run-command "echo -n > /etc/machine-id" >/dev/null
|
||||
virt-customize -q -a "${FILE}" --run-command "mkdir -p /etc/apt/keyrings && curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg" >/dev/null &&
|
||||
virt-customize -q -a "${FILE}" --run-command "echo 'deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian bookworm stable' > /etc/apt/sources.list.d/docker.list" >/dev/null &&
|
||||
virt-customize -q -a "${FILE}" --run-command "apt-get update -qq && apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin" >/dev/null &&
|
||||
virt-customize -q -a "${FILE}" --run-command "systemctl enable docker" >/dev/null &&
|
||||
virt-customize -q -a "${FILE}" --run-command "echo -n > /etc/machine-id" >/dev/null
|
||||
msg_ok "Added Docker and Docker Compose Plugin to Debian 12 Qcow2 Disk Image successfully"
|
||||
|
||||
|
||||
msg_info "Creating a Docker VM"
|
||||
qm create $VMID -agent 1${MACHINE} -tablet 0 -localtime 1 -bios ovmf${CPU_TYPE} -cores $CORE_COUNT -memory $RAM_SIZE \
|
||||
-name $HN -tags community-script,debian12,docker -net0 virtio,bridge=$BRG,macaddr=$MAC$VLAN$MTU -onboot 1 -ostype l26 -scsihw virtio-scsi-pci
|
||||
@ -442,7 +441,8 @@ qm set $VMID \
|
||||
qm resize $VMID scsi0 8G >/dev/null
|
||||
qm set $VMID --agent enabled=1 >/dev/null
|
||||
|
||||
DESCRIPTION=$(cat <<EOF
|
||||
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;'/>
|
||||
|
@ -5,8 +5,7 @@
|
||||
# License: MIT
|
||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
source /dev/stdin <<< $(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func)
|
||||
|
||||
source /dev/stdin <<<$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func)
|
||||
|
||||
function header_info {
|
||||
clear
|
||||
@ -32,7 +31,7 @@ var_os="homeassistant"
|
||||
DISK_SIZE="32G"
|
||||
#
|
||||
for version in "${VERSIONS[@]}"; do
|
||||
eval "$version=$(curl -s https://raw.githubusercontent.com/home-assistant/version/master/$version.json | grep "ova" | cut -d '"' -f 4)"
|
||||
eval "$version=$(curl -fsSL https://raw.githubusercontent.com/home-assistant/version/master/$version.json | grep "ova" | cut -d '"' -f 4)"
|
||||
done
|
||||
YW=$(echo "\033[33m")
|
||||
BL=$(echo "\033[36m")
|
||||
@ -51,11 +50,11 @@ SPINNER_PID=""
|
||||
set -Eeuo pipefail
|
||||
trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
|
||||
trap cleanup EXIT
|
||||
trap 'post_update_to_api "failed" "INTERRUPTED"' SIGINT
|
||||
trap 'post_update_to_api "failed" "INTERRUPTED"' SIGINT
|
||||
trap 'post_update_to_api "failed" "TERMINATED"' SIGTERM
|
||||
|
||||
function error_handler() {
|
||||
if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID > /dev/null; then kill $SPINNER_PID > /dev/null; fi
|
||||
if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID >/dev/null; then kill $SPINNER_PID >/dev/null; fi
|
||||
printf "\e[?25h"
|
||||
local exit_code="$?"
|
||||
local line_number="$1"
|
||||
@ -87,13 +86,13 @@ else
|
||||
fi
|
||||
|
||||
function spinner() {
|
||||
local chars="/-\|"
|
||||
local spin_i=0
|
||||
printf "\e[?25l"
|
||||
while true; do
|
||||
printf "\r \e[36m%s\e[0m" "${chars:spin_i++%${#chars}:1}"
|
||||
sleep 0.1
|
||||
done
|
||||
local chars="/-\|"
|
||||
local spin_i=0
|
||||
printf "\e[?25l"
|
||||
while true; do
|
||||
printf "\r \e[36m%s\e[0m" "${chars:spin_i++%${#chars}:1}"
|
||||
sleep 0.1
|
||||
done
|
||||
}
|
||||
|
||||
function msg_info() {
|
||||
@ -104,14 +103,14 @@ function msg_info() {
|
||||
}
|
||||
|
||||
function msg_ok() {
|
||||
if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID > /dev/null; then kill $SPINNER_PID > /dev/null; fi
|
||||
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}"
|
||||
}
|
||||
|
||||
function msg_error() {
|
||||
if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID > /dev/null; then kill $SPINNER_PID > /dev/null; fi
|
||||
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}"
|
||||
@ -134,7 +133,7 @@ function pve_check() {
|
||||
echo -e "Exiting..."
|
||||
sleep 2
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function arch_check() {
|
||||
@ -393,7 +392,6 @@ pve_check
|
||||
ssh_check
|
||||
start_script
|
||||
|
||||
|
||||
post_to_api_vm
|
||||
|
||||
msg_info "Validating Storage"
|
||||
@ -416,7 +414,7 @@ elif [ $((${#STORAGE_MENU[@]} / 3)) -eq 1 ]; then
|
||||
STORAGE=${STORAGE_MENU[0]}
|
||||
else
|
||||
while [ -z "${STORAGE:+x}" ]; do
|
||||
if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID > /dev/null; then kill $SPINNER_PID > /dev/null; fi
|
||||
if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID >/dev/null; then kill $SPINNER_PID >/dev/null; fi
|
||||
printf "\e[?25h"
|
||||
STORAGE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Storage Pools" --radiolist \
|
||||
"Which storage pool you would like to use for ${HN}?\nTo make a selection, use the Spacebar.\n" \
|
||||
@ -434,7 +432,7 @@ else
|
||||
fi
|
||||
sleep 2
|
||||
msg_ok "${CL}${BL}${URL}${CL}"
|
||||
wget -q --show-progress $URL
|
||||
curl -fsSL -o "$(basename "$URL")" "$URL"
|
||||
echo -en "\e[1A\e[0K"
|
||||
FILE=$(basename $URL)
|
||||
msg_ok "Downloaded ${CL}${BL}haos_ova-${BRANCH}.qcow2.xz${CL}"
|
||||
@ -485,5 +483,3 @@ if [ "$START_VM" == "yes" ]; then
|
||||
fi
|
||||
post_update_to_api "done" "none"
|
||||
msg_ok "Completed Successfully!\n"
|
||||
|
||||
|
||||
|
@ -5,8 +5,7 @@
|
||||
# License: MIT
|
||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
source /dev/stdin <<< $(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func)
|
||||
|
||||
source /dev/stdin <<<$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func)
|
||||
|
||||
function header_info {
|
||||
cat <<"EOF"
|
||||
@ -50,7 +49,7 @@ shopt -s expand_aliases
|
||||
alias die='EXIT=$? LINE=$LINENO error_exit'
|
||||
trap die ERR
|
||||
trap cleanup EXIT
|
||||
trap 'post_update_to_api "failed" "INTERRUPTED"' SIGINT
|
||||
trap 'post_update_to_api "failed" "INTERRUPTED"' SIGINT
|
||||
trap 'post_update_to_api "failed" "TERMINATED"' SIGTERM
|
||||
function error_exit() {
|
||||
trap - ERR
|
||||
@ -255,7 +254,7 @@ URL=https://download.mikrotik.com/routeros/7.15.3/chr-7.15.3.img.zip
|
||||
|
||||
sleep 2
|
||||
msg_ok "${CL}${BL}${URL}${CL}"
|
||||
wget -q --show-progress $URL
|
||||
curl -fsSL -o "$(basename "$URL")" "$URL"
|
||||
echo -en "\e[1A\e[0K"
|
||||
FILE=$(basename $URL)
|
||||
msg_ok "Downloaded ${CL}${BL}$FILE${CL}"
|
||||
|
@ -5,7 +5,7 @@
|
||||
# License: MIT
|
||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
source /dev/stdin <<< $(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func)
|
||||
source /dev/stdin <<<$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func)
|
||||
|
||||
function header_info {
|
||||
clear
|
||||
@ -46,7 +46,7 @@ THIN="discard=on,ssd=1"
|
||||
set -e
|
||||
trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
|
||||
trap cleanup EXIT
|
||||
trap 'post_update_to_api "failed" "INTERRUPTED"' SIGINT
|
||||
trap 'post_update_to_api "failed" "INTERRUPTED"' SIGINT
|
||||
trap 'post_update_to_api "failed" "TERMINATED"' SIGTERM
|
||||
function error_handler() {
|
||||
local exit_code="$?"
|
||||
@ -110,7 +110,7 @@ function pve_check() {
|
||||
echo -e "Exiting..."
|
||||
sleep 2
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function arch_check() {
|
||||
@ -389,7 +389,7 @@ msg_info "Retrieving the URL for the $NAME Disk Image"
|
||||
URL=http://mirror.turnkeylinux.org/turnkeylinux/images/iso/turnkey-nextcloud-18.1-bookworm-amd64.iso
|
||||
sleep 2
|
||||
msg_ok "${CL}${BL}${URL}${CL}"
|
||||
wget -q --show-progress $URL
|
||||
curl -fsSL -o "$(basename "$URL")" "$URL"
|
||||
echo -en "\e[1A\e[0K"
|
||||
FILE=$(basename $URL)
|
||||
msg_ok "Downloaded ${CL}${BL}${FILE}${CL}"
|
||||
|
@ -7,7 +7,7 @@
|
||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Based on work from https://i12bretro.github.io/tutorials/0405.html
|
||||
|
||||
source /dev/stdin <<< $(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func)
|
||||
source /dev/stdin <<<$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func)
|
||||
|
||||
function header_info {
|
||||
clear
|
||||
@ -49,7 +49,7 @@ CROSS="${RD}✗${CL}"
|
||||
set -Eeo pipefail
|
||||
trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
|
||||
trap cleanup EXIT
|
||||
trap 'post_update_to_api "failed" "INTERRUPTED"' SIGINT
|
||||
trap 'post_update_to_api "failed" "INTERRUPTED"' SIGINT
|
||||
trap 'post_update_to_api "failed" "TERMINATED"' SIGTERM
|
||||
function error_handler() {
|
||||
local exit_code="$?"
|
||||
@ -176,7 +176,7 @@ function pve_check() {
|
||||
echo -e "Exiting..."
|
||||
sleep 2
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function arch_check() {
|
||||
@ -447,13 +447,13 @@ msg_ok "Using ${CL}${BL}$STORAGE${CL} ${GN}for Storage Location."
|
||||
msg_ok "Virtual Machine ID is ${CL}${BL}$VMID${CL}."
|
||||
msg_info "Getting URL for OpenWrt Disk Image"
|
||||
|
||||
response=$(curl -s https://openwrt.org)
|
||||
response=$(curl -fsSL https://openwrt.org)
|
||||
stableversion=$(echo "$response" | sed -n 's/.*Current stable release - OpenWrt \([0-9.]\+\).*/\1/p' | head -n 1)
|
||||
URL="https://downloads.openwrt.org/releases/$stableversion/targets/x86/64/openwrt-$stableversion-x86-64-generic-ext4-combined.img.gz"
|
||||
|
||||
sleep 2
|
||||
msg_ok "${CL}${BL}${URL}${CL}"
|
||||
wget -q --show-progress $URL
|
||||
curl -fsSL -o "$(basename "$URL")" "$URL"
|
||||
echo -en "\e[1A\e[0K"
|
||||
FILE=$(basename $URL)
|
||||
msg_ok "Downloaded ${CL}${BL}$FILE${CL}"
|
||||
|
@ -4,11 +4,11 @@
|
||||
# Author: michelroegl-brunner
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
source /dev/stdin <<<$(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func)
|
||||
source /dev/stdin <<<$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func)
|
||||
|
||||
function header_info {
|
||||
clear
|
||||
cat <<"EOF"
|
||||
cat <<"EOF"
|
||||
____ ____ _ __
|
||||
/ __ \/ __ \/ | / /_______ ____ ________
|
||||
/ / / / /_/ / |/ / ___/ _ \/ __ \/ ___/ _ \
|
||||
@ -230,8 +230,8 @@ function default_settings() {
|
||||
echo -e "${DGN}Allocated Cores: ${BGN}${CORE_COUNT}${CL}"
|
||||
echo -e "${DGN}Allocated RAM: ${BGN}${RAM_SIZE}${CL}"
|
||||
if ! grep -q "^iface ${BRG}" /etc/network/interfaces; then
|
||||
msg_error "Bridge '${BRG}' does not exist in /etc/network/interfaces"
|
||||
exit
|
||||
msg_error "Bridge '${BRG}' does not exist in /etc/network/interfaces"
|
||||
exit
|
||||
else
|
||||
echo -e "${DGN}Using LAN Bridge: ${BGN}${BRG}${CL}"
|
||||
fi
|
||||
@ -527,10 +527,10 @@ msg_info "Retrieving the URL for the OPNsense Qcow2 Disk Image"
|
||||
URL=https://download.freebsd.org/releases/VM-IMAGES/14.2-RELEASE/amd64/Latest/FreeBSD-14.2-RELEASE-amd64.qcow2.xz
|
||||
sleep 2
|
||||
msg_ok "${CL}${BL}${URL}${CL}"
|
||||
wget -q --show-progress $URL
|
||||
curl -fsSL -o "$(basename "$URL")" "$URL"
|
||||
echo -en "\e[1A\e[0K"
|
||||
FILE=Fressbsd.qcow2
|
||||
unxz -cv $(basename $URL) > ${FILE}
|
||||
unxz -cv $(basename $URL) >${FILE}
|
||||
msg_ok "Downloaded ${CL}${BL}${FILE}${CL}"
|
||||
|
||||
STORAGE_TYPE=$(pvesm status -storage $STORAGE | awk 'NR>1 {print $2}')
|
||||
@ -564,10 +564,11 @@ qm set $VMID \
|
||||
-efidisk0 ${DISK0_REF}${FORMAT} \
|
||||
-scsi0 ${DISK1_REF},${DISK_CACHE}${THIN}size=2G \
|
||||
-boot order=scsi0 \
|
||||
-serial0 socket >/dev/null \
|
||||
-tags community-script
|
||||
-serial0 socket \
|
||||
-tags community-script >/dev/null
|
||||
qm resize $VMID scsi0 10G >/dev/null
|
||||
DESCRIPTION=$(cat <<EOF
|
||||
DESCRIPTION=$(
|
||||
cat <<EOF
|
||||
<div align='center'>
|
||||
<a href='https://Helper-Scripts.com' target='_blank' rel='noopener noreferrer'>
|
||||
<img src='https://raw.githubusercontent.com/michelroegl-brunner/ProxmoxVE/refs/heads/develop/misc/images/logo-81x112.png' alt='Logo' style='width:81px;height:112px;'/>
|
||||
@ -596,76 +597,76 @@ qm resize $VMID scsi0 10G >/dev/null
|
||||
</div>
|
||||
EOF
|
||||
)
|
||||
qm set "$VMID" -description "$DESCRIPTION" >/dev/null
|
||||
qm set "$VMID" -description "$DESCRIPTION" >/dev/null
|
||||
|
||||
msg_info "Bridge interfaces are being added."
|
||||
qm set $VMID \
|
||||
-net0 virtio,bridge=${BRG},macaddr=${MAC}${VLAN}${MTU} 2>/dev/null
|
||||
msg_ok "Bridge interfaces have been successfully added."
|
||||
|
||||
msg_ok "Created a OPNsense VM ${CL}${BL}(${HN})"
|
||||
msg_ok "Starting OPNsense VM (Patience this takes 20-30 minutes)"
|
||||
qm start $VMID
|
||||
sleep 90
|
||||
send_line_to_vm "root"
|
||||
send_line_to_vm "fetch https://raw.githubusercontent.com/opnsense/update/master/src/bootstrap/opnsense-bootstrap.sh.in"
|
||||
qm set $VMID \
|
||||
-net1 virtio,bridge=${WAN_BRG},macaddr=${WAN_MAC} &>/dev/null
|
||||
sleep 10
|
||||
send_line_to_vm "sh ./opnsense-bootstrap.sh.in -y -f -r 25.1"
|
||||
msg_ok "OPNsense VM is being installed, do not close the terminal, or the installation will fail."
|
||||
#We need to wait for the OPNsense build proccess to finish, this takes a few minutes
|
||||
sleep 1000
|
||||
send_line_to_vm "root"
|
||||
send_line_to_vm "opnsense"
|
||||
send_line_to_vm "2"
|
||||
|
||||
if [ "$IP_ADDR" != "" ]; then
|
||||
send_line_to_vm "1"
|
||||
send_line_to_vm "n"
|
||||
send_line_to_vm "${IP_ADDR}"
|
||||
send_line_to_vm "${NETMASK}"
|
||||
send_line_to_vm "${LAN_GW}"
|
||||
send_line_to_vm "n"
|
||||
send_line_to_vm " "
|
||||
send_line_to_vm "n"
|
||||
send_line_to_vm "n"
|
||||
send_line_to_vm " "
|
||||
send_line_to_vm "n"
|
||||
send_line_to_vm "n"
|
||||
send_line_to_vm "n"
|
||||
send_line_to_vm "n"
|
||||
send_line_to_vm "n"
|
||||
else
|
||||
send_line_to_vm "1"
|
||||
send_line_to_vm "y"
|
||||
send_line_to_vm "n"
|
||||
send_line_to_vm "n"
|
||||
send_line_to_vm " "
|
||||
send_line_to_vm "n"
|
||||
send_line_to_vm "n"
|
||||
send_line_to_vm "n"
|
||||
fi
|
||||
#we need to wait for the Config changes to be saved
|
||||
sleep 20
|
||||
if [ "$WAN_IP_ADDR" != "" ]; then
|
||||
send_line_to_vm "2"
|
||||
send_line_to_vm "2"
|
||||
send_line_to_vm "n"
|
||||
send_line_to_vm "${WAN_IP_ADDR}"
|
||||
send_line_to_vm "${NETMASK}"
|
||||
send_line_to_vm "${LAN_GW}"
|
||||
send_line_to_vm "n"
|
||||
send_line_to_vm " "
|
||||
send_line_to_vm "n"
|
||||
send_line_to_vm " "
|
||||
send_line_to_vm "n"
|
||||
send_line_to_vm "n"
|
||||
send_line_to_vm "n"
|
||||
fi
|
||||
sleep 10
|
||||
send_line_to_vm "0"
|
||||
msg_ok "Started OPNsense VM"
|
||||
msg_ok "Created a OPNsense VM ${CL}${BL}(${HN})"
|
||||
msg_ok "Starting OPNsense VM (Patience this takes 20-30 minutes)"
|
||||
qm start $VMID
|
||||
sleep 90
|
||||
send_line_to_vm "root"
|
||||
send_line_to_vm "fetch https://raw.githubusercontent.com/opnsense/update/master/src/bootstrap/opnsense-bootstrap.sh.in"
|
||||
qm set $VMID \
|
||||
-net1 virtio,bridge=${WAN_BRG},macaddr=${WAN_MAC} &>/dev/null
|
||||
sleep 10
|
||||
send_line_to_vm "sh ./opnsense-bootstrap.sh.in -y -f -r 25.1"
|
||||
msg_ok "OPNsense VM is being installed, do not close the terminal, or the installation will fail."
|
||||
#We need to wait for the OPNsense build proccess to finish, this takes a few minutes
|
||||
sleep 1000
|
||||
send_line_to_vm "root"
|
||||
send_line_to_vm "opnsense"
|
||||
send_line_to_vm "2"
|
||||
|
||||
if [ "$IP_ADDR" != "" ]; then
|
||||
send_line_to_vm "1"
|
||||
send_line_to_vm "n"
|
||||
send_line_to_vm "${IP_ADDR}"
|
||||
send_line_to_vm "${NETMASK}"
|
||||
send_line_to_vm "${LAN_GW}"
|
||||
send_line_to_vm "n"
|
||||
send_line_to_vm " "
|
||||
send_line_to_vm "n"
|
||||
send_line_to_vm "n"
|
||||
send_line_to_vm " "
|
||||
send_line_to_vm "n"
|
||||
send_line_to_vm "n"
|
||||
send_line_to_vm "n"
|
||||
send_line_to_vm "n"
|
||||
send_line_to_vm "n"
|
||||
else
|
||||
send_line_to_vm "1"
|
||||
send_line_to_vm "y"
|
||||
send_line_to_vm "n"
|
||||
send_line_to_vm "n"
|
||||
send_line_to_vm " "
|
||||
send_line_to_vm "n"
|
||||
send_line_to_vm "n"
|
||||
send_line_to_vm "n"
|
||||
fi
|
||||
#we need to wait for the Config changes to be saved
|
||||
sleep 20
|
||||
if [ "$WAN_IP_ADDR" != "" ]; then
|
||||
send_line_to_vm "2"
|
||||
send_line_to_vm "2"
|
||||
send_line_to_vm "n"
|
||||
send_line_to_vm "${WAN_IP_ADDR}"
|
||||
send_line_to_vm "${NETMASK}"
|
||||
send_line_to_vm "${LAN_GW}"
|
||||
send_line_to_vm "n"
|
||||
send_line_to_vm " "
|
||||
send_line_to_vm "n"
|
||||
send_line_to_vm " "
|
||||
send_line_to_vm "n"
|
||||
send_line_to_vm "n"
|
||||
send_line_to_vm "n"
|
||||
fi
|
||||
sleep 10
|
||||
send_line_to_vm "0"
|
||||
msg_ok "Started OPNsense VM"
|
||||
|
||||
msg_ok "Completed Successfully!\n"
|
||||
if [ "$IP_ADDR" != "" ]; then
|
||||
|
@ -5,7 +5,7 @@
|
||||
# License: MIT
|
||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
source /dev/stdin <<< $(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func)
|
||||
source /dev/stdin <<<$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func)
|
||||
|
||||
function header_info {
|
||||
clear
|
||||
@ -46,7 +46,7 @@ THIN="discard=on,ssd=1"
|
||||
set -e
|
||||
trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
|
||||
trap cleanup EXIT
|
||||
trap 'post_update_to_api "failed" "INTERRUPTED"' SIGINT
|
||||
trap 'post_update_to_api "failed" "INTERRUPTED"' SIGINT
|
||||
trap 'post_update_to_api "failed" "TERMINATED"' SIGTERM
|
||||
function error_handler() {
|
||||
local exit_code="$?"
|
||||
@ -110,7 +110,7 @@ function pve_check() {
|
||||
echo -e "Exiting..."
|
||||
sleep 2
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function arch_check() {
|
||||
@ -389,7 +389,7 @@ msg_info "Retrieving the URL for the $NAME Disk Image"
|
||||
URL=http://mirror.turnkeylinux.org/turnkeylinux/images/iso/turnkey-owncloud-18.0-bookworm-amd64.iso
|
||||
sleep 2
|
||||
msg_ok "${CL}${BL}${URL}${CL}"
|
||||
wget -q --show-progress $URL
|
||||
curl -fsSL -o "$(basename "$URL")" "$URL"
|
||||
echo -en "\e[1A\e[0K"
|
||||
FILE=$(basename $URL)
|
||||
msg_ok "Downloaded ${CL}${BL}${FILE}${CL}"
|
||||
|
@ -5,7 +5,7 @@
|
||||
# License: MIT
|
||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
source /dev/stdin <<< $(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func)
|
||||
source /dev/stdin <<<$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func)
|
||||
|
||||
function header_info {
|
||||
cat <<"EOF"
|
||||
@ -35,9 +35,9 @@ DISK_SIZE="32G"
|
||||
GEN_MAC=$(echo '00 60 2f'$(od -An -N3 -t xC /dev/urandom) | sed -e 's/ /:/g' | tr '[:lower:]' '[:upper:]')
|
||||
USEDID=$(pvesh get /cluster/resources --type vm --output-format yaml | egrep -i 'vmid' | awk '{print substr($2, 1, length($2)-0) }')
|
||||
NEXTID=$(pvesh get /cluster/nextid)
|
||||
STABLE=$(curl -s https://raw.githubusercontent.com/home-assistant/version/master/stable.json | grep "ova" | awk '{print substr($2, 2, length($2)-3) }')
|
||||
BETA=$(curl -s https://raw.githubusercontent.com/home-assistant/version/master/beta.json | grep "ova" | awk '{print substr($2, 2, length($2)-3) }')
|
||||
DEV=$(curl -s https://raw.githubusercontent.com/home-assistant/version/master/dev.json | grep "ova" | awk '{print substr($2, 2, length($2)-3) }')
|
||||
STABLE=$(curl -fsSL https://raw.githubusercontent.com/home-assistant/version/master/stable.json | grep "ova" | awk '{print substr($2, 2, length($2)-3) }')
|
||||
BETA=$(curl -fsSL https://raw.githubusercontent.com/home-assistant/version/master/beta.json | grep "ova" | awk '{print substr($2, 2, length($2)-3) }')
|
||||
DEV=$(curl -fsSL https://raw.githubusercontent.com/home-assistant/version/master/dev.json | grep "ova" | awk '{print substr($2, 2, length($2)-3) }')
|
||||
YW=$(echo "\033[33m")
|
||||
BL=$(echo "\033[36m")
|
||||
HA=$(echo "\033[1;34m")
|
||||
@ -58,7 +58,7 @@ shopt -s expand_aliases
|
||||
alias die='EXIT=$? LINE=$LINENO error_exit'
|
||||
trap die ERR
|
||||
trap cleanup EXIT
|
||||
trap 'post_update_to_api "failed" "INTERRUPTED"' SIGINT
|
||||
trap 'post_update_to_api "failed" "INTERRUPTED"' SIGINT
|
||||
trap 'post_update_to_api "failed" "TERMINATED"' SIGTERM
|
||||
function error_exit() {
|
||||
trap - ERR
|
||||
@ -84,10 +84,10 @@ function cleanup() {
|
||||
}
|
||||
TEMP_DIR=$(mktemp -d)
|
||||
pushd $TEMP_DIR >/dev/null
|
||||
if ! command -v whiptail &> /dev/null; then
|
||||
echo "Installing whiptail..."
|
||||
apt-get update &>/dev/null
|
||||
apt-get install -y whiptail &>/dev/null
|
||||
if ! command -v whiptail &>/dev/null; then
|
||||
echo "Installing whiptail..."
|
||||
apt-get update &>/dev/null
|
||||
apt-get install -y whiptail &>/dev/null
|
||||
fi
|
||||
if (whiptail --backtitle "Proxmox VE Helper Scripts" --title "PiMox HAOS VM" --yesno "This will create a New PiMox HAOS VM. Proceed?" 10 58); then
|
||||
echo "User selected Yes"
|
||||
@ -296,7 +296,7 @@ msg_info "Getting URL for Home Assistant ${BRANCH} Disk Image"
|
||||
URL=https://github.com/home-assistant/operating-system/releases/download/${BRANCH}/haos_generic-aarch64-${BRANCH}.qcow2.xz
|
||||
sleep 2
|
||||
msg_ok "${CL}${BL}${URL}${CL}"
|
||||
wget -q --show-progress $URL
|
||||
curl -fsSL -o "$(basename "$URL")" "$URL"
|
||||
echo -en "\e[1A\e[0K"
|
||||
FILE=$(basename $URL)
|
||||
msg_ok "Downloaded ${CL}${BL}haos_generic-aarch64-${BRANCH}.qcow2.xz${CL}"
|
||||
|
@ -4,7 +4,7 @@
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
source /dev/stdin <<< $(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func)
|
||||
source /dev/stdin <<<$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func)
|
||||
|
||||
function header_info {
|
||||
clear
|
||||
@ -63,7 +63,7 @@ THIN="discard=on,ssd=1,"
|
||||
set -e
|
||||
trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
|
||||
trap cleanup EXIT
|
||||
trap 'post_update_to_api "failed" "INTERRUPTED"' SIGINT
|
||||
trap 'post_update_to_api "failed" "INTERRUPTED"' SIGINT
|
||||
trap 'post_update_to_api "failed" "TERMINATED"' SIGTERM
|
||||
function error_handler() {
|
||||
local exit_code="$?"
|
||||
@ -92,7 +92,7 @@ pushd $TEMP_DIR >/dev/null
|
||||
if whiptail --backtitle "Proxmox VE Helper Scripts" --title "Ubuntu 22.04 VM" --yesno "This will create a New Ubuntu 22.04 VM. Proceed?" 10 58; then
|
||||
:
|
||||
else
|
||||
header_info && echo -e "${CROSS}${RD}User exited script${CL}\n" && exit
|
||||
header_info && echo -e "${CROSS}${RD}User exited script${CL}\n" && exit
|
||||
fi
|
||||
|
||||
function msg_info() {
|
||||
@ -121,7 +121,7 @@ function check_root() {
|
||||
}
|
||||
|
||||
function pve_check() {
|
||||
if ! pveversion | grep -Eq "pve-manager/8\.[1-3](\.[0-9]+)*"; then
|
||||
if ! pveversion | grep -Eq "pve-manager/8\.[1-3](\.[0-9]+)*"; then
|
||||
msg_error "${CROSS}${RD}This version of Proxmox Virtual Environment is not supported"
|
||||
echo -e "Requires Proxmox Virtual Environment Version 8.1 or later."
|
||||
echo -e "Exiting..."
|
||||
@ -226,7 +226,7 @@ function advanced_settings() {
|
||||
else
|
||||
exit-script
|
||||
fi
|
||||
|
||||
|
||||
if DISK_SIZE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set Disk Size in GiB (e.g., 10, 20)" 8 58 "$DISK_SIZE" --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
|
||||
DISK_SIZE=$(echo "$DISK_SIZE" | tr -d ' ')
|
||||
if [[ "$DISK_SIZE" =~ ^[0-9]+$ ]]; then
|
||||
@ -241,7 +241,7 @@ function advanced_settings() {
|
||||
else
|
||||
exit-script
|
||||
fi
|
||||
|
||||
|
||||
if DISK_CACHE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "DISK CACHE" --radiolist "Choose" --cancel-button Exit-Script 10 58 2 \
|
||||
"0" "None (Default)" ON \
|
||||
"1" "Write Through" OFF \
|
||||
@ -423,7 +423,7 @@ msg_info "Retrieving the URL for the Ubuntu 22.04 Disk Image"
|
||||
URL=https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img
|
||||
sleep 2
|
||||
msg_ok "${CL}${BL}${URL}${CL}"
|
||||
wget -q --show-progress $URL
|
||||
curl -fsSL -o "$(basename "$URL")" "$URL"
|
||||
echo -en "\e[1A\e[0K"
|
||||
FILE=$(basename $URL)
|
||||
msg_ok "Downloaded ${CL}${BL}${FILE}${CL}"
|
||||
@ -493,11 +493,11 @@ EOF
|
||||
)
|
||||
qm set "$VMID" -description "$DESCRIPTION" >/dev/null
|
||||
if [ -n "$DISK_SIZE" ]; then
|
||||
msg_info "Resizing disk to $DISK_SIZE GB"
|
||||
qm resize $VMID scsi0 ${DISK_SIZE} >/dev/null
|
||||
msg_info "Resizing disk to $DISK_SIZE GB"
|
||||
qm resize $VMID scsi0 ${DISK_SIZE} >/dev/null
|
||||
else
|
||||
msg_info "Using default disk size of $DEFAULT_DISK_SIZE GB"
|
||||
qm resize $VMID scsi0 ${DEFAULT_DISK_SIZE} >/dev/null
|
||||
msg_info "Using default disk size of $DEFAULT_DISK_SIZE GB"
|
||||
qm resize $VMID scsi0 ${DEFAULT_DISK_SIZE} >/dev/null
|
||||
fi
|
||||
|
||||
msg_ok "Created a Ubuntu 22.04 VM ${CL}${BL}(${HN})"
|
||||
|
@ -5,7 +5,7 @@
|
||||
# License: MIT
|
||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
source /dev/stdin <<< $(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func)
|
||||
source /dev/stdin <<<$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func)
|
||||
|
||||
function header_info {
|
||||
clear
|
||||
@ -29,7 +29,7 @@ var_os="ubuntu"
|
||||
var_version="2404"
|
||||
|
||||
YW=$(echo "\033[33m")
|
||||
BL=$(echo "\033[36m")
|
||||
BL=$(echo "\033[36m")
|
||||
RD=$(echo "\033[01;31m")
|
||||
BGN=$(echo "\033[4;92m")
|
||||
GN=$(echo "\033[1;92m")
|
||||
@ -64,7 +64,7 @@ THIN="discard=on,ssd=1,"
|
||||
set -e
|
||||
trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
|
||||
trap cleanup EXIT
|
||||
trap 'post_update_to_api "failed" "INTERRUPTED"' SIGINT
|
||||
trap 'post_update_to_api "failed" "INTERRUPTED"' SIGINT
|
||||
trap 'post_update_to_api "failed" "TERMINATED"' SIGTERM
|
||||
function error_handler() {
|
||||
local exit_code="$?"
|
||||
@ -93,7 +93,7 @@ pushd $TEMP_DIR >/dev/null
|
||||
if whiptail --backtitle "Proxmox VE Helper Scripts" --title "Ubuntu 24.04 VM" --yesno "This will create a New Ubuntu 24.04 VM. Proceed?" 10 58; then
|
||||
:
|
||||
else
|
||||
header_info && echo -e "${CROSS}${RD}User exited script${CL}\n" && exit
|
||||
header_info && echo -e "${CROSS}${RD}User exited script${CL}\n" && exit
|
||||
fi
|
||||
|
||||
function msg_info() {
|
||||
@ -122,7 +122,7 @@ function check_root() {
|
||||
}
|
||||
|
||||
function pve_check() {
|
||||
if ! pveversion | grep -Eq "pve-manager/8\.[1-3](\.[0-9]+)*"; then
|
||||
if ! pveversion | grep -Eq "pve-manager/8\.[1-3](\.[0-9]+)*"; then
|
||||
msg_error "${CROSS}${RD}This version of Proxmox Virtual Environment is not supported"
|
||||
echo -e "Requires Proxmox Virtual Environment Version 8.1 or later."
|
||||
echo -e "Exiting..."
|
||||
@ -227,7 +227,7 @@ function advanced_settings() {
|
||||
else
|
||||
exit-script
|
||||
fi
|
||||
|
||||
|
||||
if DISK_SIZE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set Disk Size in GiB (e.g., 10, 20)" 8 58 "$DISK_SIZE" --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
|
||||
DISK_SIZE=$(echo "$DISK_SIZE" | tr -d ' ')
|
||||
if [[ "$DISK_SIZE" =~ ^[0-9]+$ ]]; then
|
||||
@ -242,7 +242,7 @@ function advanced_settings() {
|
||||
else
|
||||
exit-script
|
||||
fi
|
||||
|
||||
|
||||
if DISK_CACHE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "DISK CACHE" --radiolist "Choose" --cancel-button Exit-Script 10 58 2 \
|
||||
"0" "None (Default)" ON \
|
||||
"1" "Write Through" OFF \
|
||||
@ -423,7 +423,7 @@ msg_info "Retrieving the URL for the Ubuntu 24.04 Disk Image"
|
||||
URL=https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img
|
||||
sleep 2
|
||||
msg_ok "${CL}${BL}${URL}${CL}"
|
||||
wget -q --show-progress $URL
|
||||
curl -fsSL -o "$(basename "$URL")" "$URL"
|
||||
echo -en "\e[1A\e[0K"
|
||||
FILE=$(basename $URL)
|
||||
msg_ok "Downloaded ${CL}${BL}${FILE}${CL}"
|
||||
@ -493,11 +493,11 @@ EOF
|
||||
)
|
||||
qm set "$VMID" -description "$DESCRIPTION" >/dev/null
|
||||
if [ -n "$DISK_SIZE" ]; then
|
||||
msg_info "Resizing disk to $DISK_SIZE GB"
|
||||
qm resize $VMID scsi0 ${DISK_SIZE} >/dev/null
|
||||
msg_info "Resizing disk to $DISK_SIZE GB"
|
||||
qm resize $VMID scsi0 ${DISK_SIZE} >/dev/null
|
||||
else
|
||||
msg_info "Using default disk size of $DEFAULT_DISK_SIZE GB"
|
||||
qm resize $VMID scsi0 ${DEFAULT_DISK_SIZE} >/dev/null
|
||||
msg_info "Using default disk size of $DEFAULT_DISK_SIZE GB"
|
||||
qm resize $VMID scsi0 ${DEFAULT_DISK_SIZE} >/dev/null
|
||||
fi
|
||||
|
||||
msg_ok "Created a Ubuntu 24.04 VM ${CL}${BL}(${HN})"
|
||||
|
@ -4,7 +4,7 @@
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
source /dev/stdin <<< $(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func)
|
||||
source /dev/stdin <<<$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func)
|
||||
|
||||
function header_info {
|
||||
clear
|
||||
@ -63,7 +63,7 @@ THIN="discard=on,ssd=1,"
|
||||
set -e
|
||||
trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
|
||||
trap cleanup EXIT
|
||||
trap 'post_update_to_api "failed" "INTERRUPTED"' SIGINT
|
||||
trap 'post_update_to_api "failed" "INTERRUPTED"' SIGINT
|
||||
trap 'post_update_to_api "failed" "TERMINATED"' SIGTERM
|
||||
function error_handler() {
|
||||
local exit_code="$?"
|
||||
@ -92,7 +92,7 @@ pushd $TEMP_DIR >/dev/null
|
||||
if whiptail --backtitle "Proxmox VE Helper Scripts" --title "Ubuntu 24.10 VM" --yesno "This will create a New Ubuntu 24.10 VM. Proceed?" 10 58; then
|
||||
:
|
||||
else
|
||||
header_info && echo -e "${CROSS}${RD}User exited script${CL}\n" && exit
|
||||
header_info && echo -e "${CROSS}${RD}User exited script${CL}\n" && exit
|
||||
fi
|
||||
|
||||
function msg_info() {
|
||||
@ -121,7 +121,7 @@ function check_root() {
|
||||
}
|
||||
|
||||
function pve_check() {
|
||||
if ! pveversion | grep -Eq "pve-manager/8\.[1-3](\.[0-9]+)*"; then
|
||||
if ! pveversion | grep -Eq "pve-manager/8\.[1-3](\.[0-9]+)*"; then
|
||||
msg_error "${CROSS}${RD}This version of Proxmox Virtual Environment is not supported"
|
||||
echo -e "Requires Proxmox Virtual Environment Version 8.1 or later."
|
||||
echo -e "Exiting..."
|
||||
@ -226,7 +226,7 @@ function advanced_settings() {
|
||||
else
|
||||
exit-script
|
||||
fi
|
||||
|
||||
|
||||
if DISK_SIZE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set Disk Size in GiB (e.g., 10, 20)" 8 58 "$DISK_SIZE" --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
|
||||
DISK_SIZE=$(echo "$DISK_SIZE" | tr -d ' ')
|
||||
if [[ "$DISK_SIZE" =~ ^[0-9]+$ ]]; then
|
||||
@ -241,7 +241,7 @@ function advanced_settings() {
|
||||
else
|
||||
exit-script
|
||||
fi
|
||||
|
||||
|
||||
if DISK_CACHE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "DISK CACHE" --radiolist "Choose" --cancel-button Exit-Script 10 58 2 \
|
||||
"0" "None (Default)" ON \
|
||||
"1" "Write Through" OFF \
|
||||
@ -423,7 +423,7 @@ msg_info "Retrieving the URL for the Ubuntu 24.10 Disk Image"
|
||||
URL=https://cloud-images.ubuntu.com/oracular/current/oracular-server-cloudimg-amd64.img
|
||||
sleep 2
|
||||
msg_ok "${CL}${BL}${URL}${CL}"
|
||||
wget -q --show-progress $URL
|
||||
curl -fsSL -o "$(basename "$URL")" "$URL"
|
||||
echo -en "\e[1A\e[0K"
|
||||
FILE=$(basename $URL)
|
||||
msg_ok "Downloaded ${CL}${BL}${FILE}${CL}"
|
||||
@ -493,11 +493,11 @@ EOF
|
||||
)
|
||||
qm set "$VMID" -description "$DESCRIPTION" >/dev/null
|
||||
if [ -n "$DISK_SIZE" ]; then
|
||||
msg_info "Resizing disk to $DISK_SIZE GB"
|
||||
qm resize $VMID scsi0 ${DISK_SIZE} >/dev/null
|
||||
msg_info "Resizing disk to $DISK_SIZE GB"
|
||||
qm resize $VMID scsi0 ${DISK_SIZE} >/dev/null
|
||||
else
|
||||
msg_info "Using default disk size of $DEFAULT_DISK_SIZE GB"
|
||||
qm resize $VMID scsi0 ${DEFAULT_DISK_SIZE} >/dev/null
|
||||
msg_info "Using default disk size of $DEFAULT_DISK_SIZE GB"
|
||||
qm resize $VMID scsi0 ${DEFAULT_DISK_SIZE} >/dev/null
|
||||
fi
|
||||
|
||||
msg_ok "Created a Ubuntu 24.10 VM ${CL}${BL}(${HN})"
|
||||
|
Reference in New Issue
Block a user