install-scripts/proxmox-scripts/install.sh
2024-11-28 22:38:29 +00:00

77 lines
2.9 KiB
Bash

#!/bin/bash
# Function to display the main menu
function show_menu() {
clear
echo "======================================"
echo " Proxmox Helper Script Installer"
echo "======================================"
echo "1. Install PVE-No-Subscription-Warning"
echo "2. Install PVE Kernel Module Patcher"
echo "3. Install PVE VM Backup Script"
echo "4. Exit"
echo "======================================"
}
# Function to install the PVE No Subscription Warning script
function install_pve_no_subscription_warning() {
clear
echo "Installing PVE-No-Subscription-Warning..."
# Backup important configuration files
backup_file "/etc/apt/sources.list"
# Add your installation command here, for example:
wget https://raw.githubusercontent.com/proxmox/pve-no-subscription-warning/master/pve-no-subscription-warning -O /usr/local/bin/pve-no-subscription-warning
chmod +x /usr/local/bin/pve-no-subscription-warning
echo "PVE-No-Subscription-Warning installed successfully!"
read -n 1 -s -r -p "Press any key to continue..."
}
# Function to install the PVE Kernel Module Patcher script
function install_pve_kernel_module_patcher() {
clear
echo "Installing PVE Kernel Module Patcher..."
# Backup important configuration files
backup_file "/etc/modprobe.d/proxmox-no-subscription.conf"
# Add your installation command here, for example:
wget https://raw.githubusercontent.com/olafm/proxmox-no-subscription-patch/master/pve-no-subscription-patch -O /usr/local/bin/pve-kernel-module-patcher
chmod +x /usr/local/bin/pve-kernel-module-patcher
echo "PVE Kernel Module Patcher installed successfully!"
read -n 1 -s -r -p "Press any key to continue..."
}
# Function to install the PVE VM Backup Script
function install_pve_vm_backup_script() {
clear
echo "Installing PVE VM Backup Script..."
# Add your installation command here, for example:
wget https://raw.githubusercontent.com/erikng/proxmox-scripts/master/backup-vm.sh -O /usr/local/bin/pve-vm-backup
chmod +x /usr/local/bin/pve-vm-backup
echo "PVE VM Backup Script installed successfully!"
read -n 1 -s -r -p "Press any key to continue..."
}
# Function to backup files
function backup_file() {
local file=$1
if [ -f $file ]; then
local timestamp=$(date +%Y%m%d_%H%M%S)
local backup_file="/root/backup_$timestamp_$(basename $file)"
echo "Backing up $file to $backup_file"
rsync -a --delete $file $backup_file
else
echo "$file does not exist. Skipping backup."
fi
}
# Main loop
while true; do
show_menu
read -p "Please enter your choice: " choice
case $choice in
1) install_pve_no_subscription_warning ;;
2) install_pve_kernel_module_patcher ;;
3) install_pve_vm_backup_script ;;
4) exit 0 ;;
*) echo "Invalid option. Please enter a number between 1 and 4." ;;
esac
done