Compare commits

...

9 Commits

Author SHA1 Message Date
tteckster edd2c4100f
Create pve8-post-install.sh 2023-06-09 12:50:12 -04:00
tteckster 7b20f5aef8
Update haos-vm.sh
PVE 8 ready
2023-06-09 12:43:07 -04:00
tteckster fb3502c0bd
Update build.func
add Ubuntu 23.04
remove Ubuntu 22.10
2023-06-09 09:07:03 -04:00
tteckster 3efff3572e
Update alpine.sh
Alpine 3.18
2023-06-09 07:32:50 -04:00
tteckster 36048c4e91
Update alpine-zigbee2mqtt.sh
Alpine 3.18
2023-06-09 07:32:28 -04:00
tteckster bf96e4b7aa
Update alpine-vaultwarden.sh
Alpine 3.18
2023-06-09 07:32:04 -04:00
tteckster 6df18b2bf5
Update alpine-grafana.sh
Alpine 3.18
2023-06-09 07:31:41 -04:00
tteckster f0d066b6ed
Update alpine-docker.sh
Alpine 3.18
2023-06-09 07:27:55 -04:00
tteckster 8af136338a
Update build.func
Prepare for Proxmox Virtual Environment 8
2023-06-09 06:30:37 -04:00
8 changed files with 218 additions and 8 deletions

View File

@ -24,7 +24,7 @@ var_disk="2"
var_cpu="1"
var_ram="1024"
var_os="alpine"
var_version="3.17"
var_version="3.18"
variables
color
catch_errors

View File

@ -24,7 +24,7 @@ var_disk="0.5"
var_cpu="1"
var_ram="256"
var_os="alpine"
var_version="3.17"
var_version="3.18"
variables
color
catch_errors

View File

@ -24,7 +24,7 @@ var_disk="0.3"
var_cpu="1"
var_ram="256"
var_os="alpine"
var_version="3.17"
var_version="3.18"
variables
color
catch_errors

View File

@ -24,7 +24,7 @@ var_disk="0.3"
var_cpu="1"
var_ram="256"
var_os="alpine"
var_version="3.17"
var_version="3.18"
variables
color
catch_errors

View File

@ -24,7 +24,7 @@ var_disk="0.1"
var_cpu="1"
var_ram="512"
var_os="alpine"
var_version="3.17"
var_version="3.18"
variables
color
catch_errors

View File

@ -54,7 +54,7 @@ msg_error() {
# This function checks the version of Proxmox Virtual Environment (PVE) and exits if the version is not supported.
pve_check() {
if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
if ! pveversion | grep -Eq "pve-manager/(7\.[0-9]|8\.[0-9])"; then
echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
echo -e "Requires PVE Version 7.0 or higher"
echo -e "Exiting..."
@ -153,7 +153,7 @@ advanced_settings() {
if var_version=$(whiptail --title "UBUNTU VERSION" --radiolist "Choose Version" 10 58 3 \
"20.04" "Focal" OFF \
"22.04" "Jammy" OFF \
"22.10" "Kinetic" OFF \
"23.04" "Lunar" OFF \
3>&1 1>&2 2>&3); then
if [ -n "$var_version" ]; then
echo -e "${DGN}Using $var_os Version: ${BGN}$var_version${CL}"

210
misc/pve8-post-install.sh Normal file
View File

@ -0,0 +1,210 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2023 tteck
# Author: tteck (tteckster)
# License: MIT
# https://github.com/tteck/Proxmox/raw/main/LICENSE
header_info() {
clear
cat <<"EOF"
____ _ ____________ ____ __ ____ __ ____
/ __ \ | / / ____( __ ) / __ \____ _____/ /_ / _/___ _____/ /_____ _/ / /
/ /_/ / | / / __/ / __ | / /_/ / __ \/ ___/ __/ / // __ \/ ___/ __/ __ `/ / /
/ ____/| |/ / /___/ /_/ / / ____/ /_/ (__ ) /_ _/ // / / (__ ) /_/ /_/ / / /
/_/ |___/_____/\____/ /_/ \____/____/\__/ /___/_/ /_/____/\__/\__,_/_/_/
EOF
}
RD=$(echo "\033[01;31m")
YW=$(echo "\033[33m")
GN=$(echo "\033[1;92m")
CL=$(echo "\033[m")
BFR="\\r\\033[K"
HOLD="-"
CM="${GN}${CL}"
CROSS="${RD}${CL}"
set -euo pipefail
shopt -s inherit_errexit nullglob
msg_info() {
local msg="$1"
echo -ne " ${HOLD} ${YW}${msg}..."
}
msg_ok() {
local msg="$1"
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
}
msg_error() {
local msg="$1"
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
}
start_routines() {
header_info
CHOICE=$(whiptail --title "PVE-ENTERPRISE" --menu "The 'pve-enterprise' repository is only available to users who have purchased a Proxmox VE subscription.\n \nDisable 'pve-enterprise' repository?" 14 58 2 \
"yes" " " \
"no" " " 3>&2 2>&1 1>&3)
case $CHOICE in
yes)
msg_info "Disabling 'pve-enterprise' repository"
sed -i 's/^deb/#deb/g' /etc/apt/sources.list.d/pve-enterprise.list
msg_ok "Disabled 'pve-enterprise' repository"
;;
no)
msg_error "Selected no to Disabling 'pve-enterprise' repository"
;;
esac
CHOICE=$(whiptail --title "SOURCES" --menu "The package manager will use the correct sources to update and install packages on your Proxmox VE 8 server.\n \nCorrect Proxmox VE 8 sources?" 14 58 2 \
"yes" " " \
"no" " " 3>&2 2>&1 1>&3)
case $CHOICE in
yes)
msg_info "Correcting Proxmox VE 8 Sources"
cat <<EOF >/etc/apt/sources.list
deb http://ftp.debian.org/debian bookworm main contrib
deb http://ftp.debian.org/debian bookworm-updates main contrib
deb http://security.debian.org/debian-security bookworm-security main contrib
EOF
msg_ok "Corrected Proxmox VE 8 Sources"
;;
no)
msg_error "Selected no to Correcting Proxmox VE 8 Sources"
;;
esac
CHOICE=$(whiptail --title "PVE-NO-SUBSCRIPTION" --menu "The 'pve-no-subscription' repository provides access to all of the open-source components of Proxmox VE.\n \nEnable 'pve-no-subscription' repository?" 14 58 2 \
"yes" " " \
"no" " " 3>&2 2>&1 1>&3)
case $CHOICE in
yes)
msg_info "Enabling 'pve-no-subscription' repository"
cat <<EOF >>/etc/apt/sources.list
deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription
EOF
msg_ok "Enabled 'pve-no-subscription' repository"
;;
no)
msg_error "Selected no to Enabling 'pve-no-subscription' repository"
;;
esac
CHOICE=$(whiptail --title "PVETEST" --menu "The 'pvetest' repository can give advanced users access to new features and updates before they are officially released.\n \nAdd (Disabled) 'pvetest' repository?" 14 58 2 \
"yes" " " \
"no" " " 3>&2 2>&1 1>&3)
case $CHOICE in
yes)
msg_info "Adding 'pvetest' repository and set disabled"
cat <<EOF >>/etc/apt/sources.list
# deb http://download.proxmox.com/debian/pve bookworm pvetest
EOF
msg_ok "Added 'pvetest' repository"
;;
no)
msg_error "Selected no to Adding 'pvetest' repository"
;;
esac
if [[ ! -f /etc/apt/apt.conf.d/no-nag-script ]]; then
CHOICE=$(whiptail --title "SUBSCRIPTION NAG" --menu "This will disable the nag message reminding you to purchase a subscription every time you log in to the web interface.\n \nDisable subscription nag?" 14 58 2 \
"yes" " " \
"no" " " 3>&2 2>&1 1>&3)
case $CHOICE in
yes)
msg_info "Disabling subscription nag"
echo "DPkg::Post-Invoke { \"dpkg -V proxmox-widget-toolkit | grep -q '/proxmoxlib\.js$'; if [ \$? -eq 1 ]; then { echo 'Removing subscription nag from UI...'; sed -i '/data\.status.*{/{s/\!//;s/active/NoMoreNagging/}' /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js; }; fi\"; };" >/etc/apt/apt.conf.d/no-nag-script
apt --reinstall install proxmox-widget-toolkit &>/dev/null
msg_ok "Disabled subscription nag (Delete browser cache)"
;;
no)
msg_error "Selected no to Disabling subscription nag"
;;
esac
fi
if systemctl is-active --quiet pve-ha-lrm; then
CHOICE=$(whiptail --title "HIGH AVAILABILITY" --menu "If you plan to utilize a single node instead of a clustered environment, you can disable unnecessary high availability (HA) services, thus reclaiming system resources.\n\nIf HA becomes necessary at a later stage, the services can be re-enabled.\n\nDisable high availability?" 18 58 2 \
"yes" " " \
"no" " " 3>&2 2>&1 1>&3)
case $CHOICE in
yes)
msg_info "Disabling high availability"
systemctl stop pve-ha-lrm
systemctl disable pve-ha-lrm &>/dev/null
systemctl stop pve-ha-crm
systemctl disable pve-ha-crm &>/dev/null
systemctl stop corosync
systemctl disable corosync &>/dev/null
msg_ok "Disabled high availability"
;;
no)
msg_error "Selected no to Disabling high availability"
;;
esac
fi
CHOICE=$(whiptail --title "UPDATE" --menu "\nUpdate Proxmox VE 8 now?" 11 58 2 \
"yes" " " \
"no" " " 3>&2 2>&1 1>&3)
case $CHOICE in
yes)
msg_info "Updating Proxmox VE 8 (Patience)"
apt-get update &>/dev/null
apt-get -y dist-upgrade &>/dev/null
msg_ok "Updated Proxmox VE 8"
;;
no)
msg_error "Selected no to Updating Proxmox VE 8"
;;
esac
CHOICE=$(whiptail --title "REBOOT" --menu "\nReboot Proxmox VE 8 now? (recommended)" 11 58 2 \
"yes" " " \
"no" " " 3>&2 2>&1 1>&3)
case $CHOICE in
yes)
msg_info "Rebooting Proxmox VE 8"
sleep 2
msg_ok "Completed Post Install Routines"
reboot
;;
no)
msg_error "Selected no to Rebooting Proxmox VE 8 (Reboot recommended)"
msg_ok "Completed Post Install Routines"
;;
esac
}
header_info
echo -e "\nThis script will Perform Post Install Routines.\n"
while true; do
read -p "Start the Proxmox VE 8 Post Install Script (y/n)?" yn
case $yn in
[Yy]*) break ;;
[Nn]*) clear; exit ;;
*) echo "Please answer yes or no." ;;
esac
done
if ! command -v pveversion >/dev/null 2>&1; then
header_info
msg_error "\n No PVE Detected!\n"
exit
fi
if [ $(pveversion | grep "pve-manager/8" | wc -l) -ne 1 ]; then
header_info
msg_error "This version of Proxmox Virtual Environment is not supported"
echo -e " Requires PVE Version: 8.XX"
echo -e "\nExiting..."
sleep 3
exit
fi
start_routines

View File

@ -85,7 +85,7 @@ function msg_error() {
}
function pve_check() {
if [ $(pveversion | grep -c "pve-manager/7\.[2-9]") -eq 0 ]; then
if ! pveversion | grep -Eq "pve-manager/(7\.[2-9]|8\.[0-9])"; then
echo -e "${CROSS} This version of Proxmox Virtual Environment is not supported"
echo -e "Requires PVE Version 7.2 or higher"
echo -e "Exiting..."