Update ubuntu2410-vm.sh

This commit is contained in:
CanbiZ 2025-06-16 11:40:22 +02:00
parent fcb3a2c725
commit d54c96c5bd

View File

@ -22,6 +22,7 @@ echo -e "\n Loading..."
GEN_MAC=02:$(openssl rand -hex 5 | awk '{print toupper($0)}' | sed 's/\(..\)/\1:/g; s/.$//') GEN_MAC=02:$(openssl rand -hex 5 | awk '{print toupper($0)}' | sed 's/\(..\)/\1:/g; s/.$//')
RANDOM_UUID="$(cat /proc/sys/kernel/random/uuid)" RANDOM_UUID="$(cat /proc/sys/kernel/random/uuid)"
METHOD="" METHOD=""
APP="Ubuntu 24.10 VM"
NSAPP="ubuntu-2410-vm" NSAPP="ubuntu-2410-vm"
var_os="ubuntu" var_os="ubuntu"
var_version="2410" var_version="2410"
@ -105,7 +106,7 @@ function cleanup() {
TEMP_DIR=$(mktemp -d) TEMP_DIR=$(mktemp -d)
pushd $TEMP_DIR >/dev/null 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 if whiptail --backtitle "Proxmox VE Helper Scripts" --title "$APP" --yesno "This will create a New $APP. Proceed?" 10 58; then
: :
else 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
@ -204,7 +205,7 @@ function default_settings() {
echo -e "${VLANTAG}${BOLD}${DGN}VLAN: ${BGN}Default${CL}" echo -e "${VLANTAG}${BOLD}${DGN}VLAN: ${BGN}Default${CL}"
echo -e "${DEFAULT}${BOLD}${DGN}Interface MTU Size: ${BGN}Default${CL}" echo -e "${DEFAULT}${BOLD}${DGN}Interface MTU Size: ${BGN}Default${CL}"
echo -e "${GATEWAY}${BOLD}${DGN}Start VM when completed: ${BGN}yes${CL}" echo -e "${GATEWAY}${BOLD}${DGN}Start VM when completed: ${BGN}yes${CL}"
echo -e "${CREATING}${BOLD}${DGN}Creating a Ubuntu 24.10 VM using the above default settings${CL}" echo -e "${CREATING}${BOLD}${DGN}Creating a $APP using the above default settings${CL}"
} }
function advanced_settings() { function advanced_settings() {
@ -383,8 +384,8 @@ function advanced_settings() {
START_VM="no" START_VM="no"
fi fi
if (whiptail --backtitle "Proxmox VE Helper Scripts" --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create a Ubuntu 24.10 VM?" --no-button Do-Over 10 58); then if (whiptail --backtitle "Proxmox VE Helper Scripts" --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create a $APP?" --no-button Do-Over 10 58); then
echo -e "${CREATING}${BOLD}${DGN}Creating a Ubuntu 24.10 VM using the above advanced settings${CL}" echo -e "${CREATING}${BOLD}${DGN}Creating a $APP using the above advanced settings${CL}"
else else
header_info header_info
echo -e "${ADVANCED}${BOLD}${RD}Using Advanced Settings${CL}" echo -e "${ADVANCED}${BOLD}${RD}Using Advanced Settings${CL}"
@ -470,7 +471,7 @@ for i in {0,1}; do
eval DISK${i}_REF=${STORAGE}:${DISK_REF:-}${!disk} eval DISK${i}_REF=${STORAGE}:${DISK_REF:-}${!disk}
done done
msg_info "Creating a Ubuntu 24.10 VM" msg_info "Creating a $APP"
qm create $VMID -agent 1${MACHINE} -tablet 0 -localtime 1 -bios ovmf${CPU_TYPE} -cores $CORE_COUNT -memory $RAM_SIZE \ 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;ubuntu" -net0 virtio,bridge=$BRG,macaddr=$MAC$VLAN$MTU -onboot 1 -ostype l26 -scsihw virtio-scsi-pci -name $HN -tags "community-script;ubuntu" -net0 virtio,bridge=$BRG,macaddr=$MAC$VLAN$MTU -onboot 1 -ostype l26 -scsihw virtio-scsi-pci
pvesm alloc $STORAGE $VMID $DISK0 4M 1>&/dev/null pvesm alloc $STORAGE $VMID $DISK0 4M 1>&/dev/null
@ -490,7 +491,7 @@ DESCRIPTION=$(
<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/main/misc/images/logo-81x112.png' alt='Logo' style='width:81px;height:112px;'/>
</a> </a>
<h2 style='font-size: 24px; margin: 20px 0;'>Ubuntu 24.10 VM</h2> <h2 style='font-size: 24px; margin: 20px 0;'>$APP</h2>
<p style='margin: 16px 0;'> <p style='margin: 16px 0;'>
<a href='https://ko-fi.com/community_scripts' target='_blank' rel='noopener noreferrer'> <a href='https://ko-fi.com/community_scripts' target='_blank' rel='noopener noreferrer'>
@ -524,11 +525,11 @@ else
msg_ok "Resized disk to ${CL}${BL}${DEFAULT_DISK_SIZE}${CL} GB" msg_ok "Resized disk to ${CL}${BL}${DEFAULT_DISK_SIZE}${CL} GB"
fi fi
msg_ok "Created a Ubuntu 24.10 VM ${CL}${BL}(${HN})" msg_ok "Created a $APP ${CL}${BL}(${HN})"
if [ "$START_VM" == "yes" ]; then if [ "$START_VM" == "yes" ]; then
msg_info "Starting Ubuntu 24.10 VM" msg_info "Starting $APP"
qm start $VMID qm start $VMID
msg_ok "Started Ubuntu 24.10 VM" msg_ok "Started $APP"
fi fi
post_update_to_api "done" "none" post_update_to_api "done" "none"
msg_ok "Completed Successfully!\n" msg_ok "Completed Successfully!\n"