mirror of https://github.com/tteck/Proxmox.git
Compare commits
No commits in common. "4b5069f2bc99d1b53f89ab7453f38f1b074ace3a" and "3db776e749356d18e30d8c977da4786419e694a5" have entirely different histories.
4b5069f2bc
...
3db776e749
|
@ -4,13 +4,6 @@
|
|||
|
||||
- All LXC instances created using this repository come pre-installed with Midnight Commander, which is a command-line tool (`mc`) that offers a user-friendly file and directory management interface for the terminal environment.
|
||||
|
||||
## 2023-09-14
|
||||
|
||||
### Changed
|
||||
|
||||
- **Proxmox VE Processor Microcode**
|
||||
- Allow users to select available microcode packages.
|
||||
|
||||
## 2023-09-13
|
||||
|
||||
### Changed
|
||||
|
|
|
@ -30,7 +30,7 @@ msg_info "Installing PostgreSQL"
|
|||
$STD apt-get update
|
||||
$STD apt-get install -y postgresql
|
||||
|
||||
cat <<EOF >/etc/postgresql/16/main/pg_hba.conf
|
||||
cat <<EOF >/etc/postgresql/15/main/pg_hba.conf
|
||||
# PostgreSQL Client Authentication Configuration File
|
||||
local all postgres peer
|
||||
# TYPE DATABASE USER ADDRESS METHOD
|
||||
|
@ -49,7 +49,7 @@ host replication all 127.0.0.1/32 scram-sha-256
|
|||
host replication all ::1/128 scram-sha-256
|
||||
EOF
|
||||
|
||||
cat <<EOF >/etc/postgresql/16/main/postgresql.conf
|
||||
cat <<EOF >/etc/postgresql/15/main/postgresql.conf
|
||||
# -----------------------------
|
||||
# PostgreSQL configuration file
|
||||
# -----------------------------
|
||||
|
@ -58,10 +58,10 @@ cat <<EOF >/etc/postgresql/16/main/postgresql.conf
|
|||
# FILE LOCATIONS
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
data_directory = '/var/lib/postgresql/16/main'
|
||||
hba_file = '/etc/postgresql/16/main/pg_hba.conf'
|
||||
ident_file = '/etc/postgresql/16/main/pg_ident.conf'
|
||||
external_pid_file = '/var/run/postgresql/16-main.pid'
|
||||
data_directory = '/var/lib/postgresql/15/main'
|
||||
hba_file = '/etc/postgresql/15/main/pg_hba.conf'
|
||||
ident_file = '/etc/postgresql/15/main/pg_ident.conf'
|
||||
external_pid_file = '/var/run/postgresql/15-main.pid'
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# CONNECTIONS AND AUTHENTICATION
|
||||
|
@ -107,7 +107,7 @@ log_timezone = 'Etc/UTC'
|
|||
# PROCESS TITLE
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
cluster_name = '16/main'
|
||||
cluster_name = '15/main'
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# CLIENT CONNECTION DEFAULTS
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
# https://github.com/tteck/Proxmox/raw/main/LICENSE
|
||||
|
||||
function header_info {
|
||||
clear
|
||||
cat <<"EOF"
|
||||
clear
|
||||
cat <<"EOF"
|
||||
____ __ ____ __
|
||||
/ __ \_________ ________ ______________ _____ / |/ (_)_____________ _________ ____/ /__
|
||||
/ /_/ / ___/ __ \/ ___/ _ \/ ___/ ___/ __ \/ ___/ / /|_/ / / ___/ ___/ __ \/ ___/ __ \/ __ / _ \
|
||||
|
@ -25,99 +25,90 @@ HOLD="-"
|
|||
CM="${GN}✓${CL}"
|
||||
CROSS="${RD}✗${CL}"
|
||||
|
||||
msg_info() { echo -ne " ${HOLD} ${YW}$1..."; }
|
||||
msg_ok() { echo -e "${BFR} ${CM} ${GN}$1${CL}"; }
|
||||
msg_error() { echo -e "${BFR} ${CROSS} ${RD}$1${CL}"; }
|
||||
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}"
|
||||
}
|
||||
|
||||
header_info
|
||||
current_microcode=$(journalctl -k | grep -E "microcode: microcode" | awk -F 'microcode: microcode updated early to revision |, date = ' '{print $2 ", date = " $3}')
|
||||
[ -z "$current_microcode" ] && current_microcode="Not found."
|
||||
current_microcode=$(dmesg | grep -o 'microcode updated early to revision [^,]*, date = [0-9\-]*')
|
||||
while true; do
|
||||
if [ -z "${current_microcode}" ]; then
|
||||
msg_error "Microcode update information not found."
|
||||
else
|
||||
msg_ok "Current ${current_microcode}"
|
||||
fi
|
||||
read -p "Install the latest Processor Microcode (y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
header_info
|
||||
|
||||
intel() {
|
||||
if ! dpkg -s iucode-tool >/dev/null 2>&1; then
|
||||
msg_info "Installing iucode-tool (Intel microcode updater)"
|
||||
msg_info "Installing iucode-tool: a tool for updating Intel processor microcode"
|
||||
apt-get install -y iucode-tool &>/dev/null
|
||||
msg_ok "Installed iucode-tool"
|
||||
else
|
||||
msg_ok "Intel iucode-tool is already installed"
|
||||
sleep 1
|
||||
fi
|
||||
|
||||
msg_info "Downloading the latest Intel Processor Microcode Package for Linux"
|
||||
wget -q http://ftp.debian.org/debian/pool/non-free-firmware/i/intel-microcode/intel-microcode_3.20230808.1_amd64.deb
|
||||
msg_ok "Downloaded the latest Intel Processor Microcode Package"
|
||||
|
||||
intel_microcode=$(curl -fsSL "https://ftp.debian.org/debian/pool/non-free-firmware/i/intel-microcode//" | grep -o 'href="[^"]*amd64.deb"' | sed 's/href="//;s/"//')
|
||||
[ -z "$intel_microcode" ] && { whiptail --backtitle "Proxmox VE Helper Scripts" --title "No Microcode Found" --msgbox "It appears there were no microcode packages found\n Try again later." 10 68; msg_info "Exiting"; sleep 1; msg_ok "Done"; exit; }
|
||||
|
||||
CTID_MENU=()
|
||||
MSG_MAX_LENGTH=0
|
||||
|
||||
while read -r TAG ITEM; do
|
||||
OFFSET=2
|
||||
(( ${#ITEM} + OFFSET > MSG_MAX_LENGTH )) && MSG_MAX_LENGTH=${#ITEM}+OFFSET
|
||||
CTID_MENU+=("$TAG" "$ITEM " "OFF")
|
||||
done < <(echo "$intel_microcode")
|
||||
|
||||
microcode=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Current Microcode revision:${current_microcode}" --radiolist "\nSelect a microcode package to install:\n" 16 $((MSG_MAX_LENGTH + 58)) 6 "${CTID_MENU[@]}" 3>&1 1>&2 2>&3 | tr -d '"') || exit
|
||||
|
||||
[ -z "$microcode" ] && { whiptail --backtitle "Proxmox VE Helper Scripts" --title "No Microcode Selected" --msgbox "It appears that no microcode packages were selected" 10 68; msg_info "Exiting"; sleep 1; msg_ok "Done"; exit; }
|
||||
|
||||
msg_info "Downloading the Intel Processor Microcode Package $microcode"
|
||||
wget -q http://ftp.debian.org/debian/pool/non-free-firmware/i/intel-microcode/$microcode
|
||||
msg_ok "Downloaded the Intel Processor Microcode Package $microcode"
|
||||
|
||||
msg_info "Installing $microcode (Patience)"
|
||||
dpkg -i $microcode &>/dev/null
|
||||
msg_ok "Installed $microcode"
|
||||
msg_info "Installing the Intel Processor Microcode (Patience)"
|
||||
dpkg -i intel-microcode_3.20230808.1_amd64.deb &>/dev/null
|
||||
msg_ok "Installed the Intel Processor Microcode"
|
||||
|
||||
msg_info "Cleaning up"
|
||||
rm $microcode
|
||||
rm intel-microcode_3.20230808.1_amd64.deb
|
||||
msg_ok "Cleaned"
|
||||
echo -e "\nIn order to apply the changes, a system reboot will be necessary.\n"
|
||||
|
||||
echo -e "\n To apply the changes, the system will need to be rebooted.\n"
|
||||
}
|
||||
|
||||
amd() {
|
||||
amd_microcode=$(curl -fsSL "https://ftp.debian.org/debian/pool/non-free-firmware/a/amd64-microcode///" | grep -o 'href="[^"]*amd64.deb"' | sed 's/href="//;s/"//')
|
||||
msg_info "Downloading the latest AMD Processor Microcode Package for Linux"
|
||||
wget -q http://ftp.debian.org/debian/pool/non-free-firmware/a/amd64-microcode/amd64-microcode_3.20230808.1.1_amd64.deb
|
||||
msg_ok "Downloaded the latest AMD Processor Microcode Package"
|
||||
|
||||
[ -z "$amd_microcode" ] && { whiptail --backtitle "Proxmox VE Helper Scripts" --title "No Microcode Found" --msgbox "It appears there were no microcode packages found\n Try again later." 10 68; msg_info "Exiting"; sleep 1; msg_ok "Done"; exit; }
|
||||
|
||||
CTID_MENU=()
|
||||
MSG_MAX_LENGTH=0
|
||||
|
||||
while read -r TAG ITEM; do
|
||||
OFFSET=2
|
||||
(( ${#ITEM} + OFFSET > MSG_MAX_LENGTH )) && MSG_MAX_LENGTH=${#ITEM}+OFFSET
|
||||
CTID_MENU+=("$TAG" "$ITEM " "OFF")
|
||||
done < <(echo "$amd_microcode")
|
||||
|
||||
microcode=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Current Microcode revision:${current_microcode}" --radiolist "\nSelect a microcode package to install:\n" 16 $((MSG_MAX_LENGTH + 58)) 6 "${CTID_MENU[@]}" 3>&1 1>&2 2>&3 | tr -d '"') || exit
|
||||
|
||||
[ -z "$microcode" ] && { whiptail --backtitle "Proxmox VE Helper Scripts" --title "No Microcode Selected" --msgbox "It appears that no microcode packages were selected" 10 68; msg_info "Exiting"; sleep 1; msg_ok "Done"; exit; }
|
||||
|
||||
msg_info "Downloading the AMD Processor Microcode Package $microcode"
|
||||
wget -q https://ftp.debian.org/debian/pool/non-free-firmware/a/amd64-microcode/$microcode
|
||||
msg_ok "Downloaded the AMD Processor Microcode Package $microcode"
|
||||
|
||||
msg_info "Installing $microcode (Patience)"
|
||||
dpkg -i $microcode &>/dev/null
|
||||
msg_ok "Installed $microcode"
|
||||
msg_info "Installing the AMD Processor Microcode (Patience)"
|
||||
dpkg -i amd64-microcode_3.20230808.1.1_amd64.deb &>/dev/null
|
||||
msg_ok "Installed the AMD Processor Microcode"
|
||||
|
||||
msg_info "Cleaning up"
|
||||
rm $microcode
|
||||
rm amd64-microcode_3.20230808.1.1_amd64.deb
|
||||
msg_ok "Cleaned"
|
||||
echo -e "\nIn order to apply the changes, a system reboot will be necessary.\n"
|
||||
|
||||
echo -e "\n To apply the changes, the system will need to be rebooted.\n"
|
||||
}
|
||||
|
||||
if ! command -v pveversion >/dev/null 2>&1; then header_info; msg_error "No PVE Detected!"; exit; fi
|
||||
|
||||
whiptail --backtitle "Proxmox VE Helper Scripts" --title "Proxmox VE Processor Microcode" --yesno "This will check for CPU microcode packages with the option to install. Proceed?" 10 58 || exit
|
||||
|
||||
if ! command -v pveversion >/dev/null 2>&1; then
|
||||
header_info
|
||||
msg_error "\n No PVE Detected!\n"
|
||||
exit
|
||||
fi
|
||||
msg_info "Checking CPU Vendor"
|
||||
cpu=$(lscpu | grep -oP 'Vendor ID:\s*\K\S+' | head -n 1)
|
||||
if [ "$cpu" == "GenuineIntel" ]; then
|
||||
msg_ok "${cpu} was detected"
|
||||
sleep 1
|
||||
intel
|
||||
elif [ "$cpu" == "AuthenticAMD" ]; then
|
||||
msg_ok "${cpu} was detected"
|
||||
sleep 1
|
||||
amd
|
||||
else
|
||||
msg_error "${cpu} is not supported"
|
||||
|
|
Loading…
Reference in New Issue