Update netdata.sh

tweak
This commit is contained in:
tteckster 2023-12-20 04:12:13 -05:00 committed by GitHub
parent fb394e9e81
commit b3a6f29bc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,7 +17,7 @@ EOF
install() { install() {
while true; do while true; do
read -p "This script will install NetData on Proxmox VE. Proceed(y/n)?" yn read -p "This script will install NetData on Proxmox VE 8+. Proceed(y/n)?" yn
case $yn in case $yn in
[Yy]*) break ;; [Yy]*) break ;;
[Nn]*) exit ;; [Nn]*) exit ;;
@ -45,16 +45,17 @@ userdel netdata
echo -e "\nRemoved NetData from Proxmox VE\n" echo -e "\nRemoved NetData from Proxmox VE\n"
} }
if ! command -v pveversion >/dev/null 2>&1; then if ! pveversion | grep -Eq "pve-manager/(8\.[0-9])"; then
clear msg_error "This version of Proxmox Virtual Environment is not supported"
echo -e "\n No PVE Detected!\n" echo -e "Requires PVE Version 8.0 or higher"
echo -e "Exiting..."
sleep 2
exit exit
fi fi
OPTIONS=(Install "Install NetData on Proxmox VE" \ OPTIONS=(Install "Install NetData on Proxmox VE" \
Uninstall "Uninstall NetData from Proxmox VE") Uninstall "Uninstall NetData from Proxmox VE")
# Show the whiptail menu and save the user's choice
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "NetData" --menu "Select an option:" 10 58 2 \ CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "NetData" --menu "Select an option:" 10 58 2 \
"${OPTIONS[@]}" 3>&1 1>&2 2>&3) "${OPTIONS[@]}" 3>&1 1>&2 2>&3)