Some code cleanup

Enable copying of backup files
This commit is contained in:
Meliox 2023-06-27 20:16:56 +02:00
parent 1469e64ba7
commit 496b250ca3

View File

@ -5,7 +5,6 @@
pvemanagerlib="/usr/share/pve-manager/js/pvemanagerlib.js" pvemanagerlib="/usr/share/pve-manager/js/pvemanagerlib.js"
nodespm="/usr/share/perl5/PVE/API2/Nodes.pm" nodespm="/usr/share/perl5/PVE/API2/Nodes.pm"
backuplocation="/root/backup" backuplocation="/root/backup"
timestamp=$(date '+%Y-%m-%d_%H-%M-%S')
# Sensor configuration # Sensor configuration
# CPU. See tempN_in put for "Core 0" using sensor -j # CPU. See tempN_in put for "Core 0" using sensor -j
@ -17,6 +16,8 @@ HDDPerRow="4";
NVMEPerRow="4"; NVMEPerRow="4";
################### code below ############# ################### code below #############
timestamp=$(date '+%Y-%m-%d_%H-%M-%S')
echo "" echo ""
# Function to display usage information # Function to display usage information
@ -26,12 +27,10 @@ function usage {
exit 1 exit 1
} }
#!/bin/bash
# Define a function to install packages # Define a function to install packages
install_packages () { install_packages () {
# Check if the 'sensors' command is available on the system # Check if the 'sensors' command is available on the system
if ! command -v sensors &> /dev/null; then if (! command -v sensors &> /dev/null); then
# If the 'sensors' command is not available, prompt the user to install lm-sensors # If the 'sensors' command is not available, prompt the user to install lm-sensors
read -p "lm-sensors is not installed. Would you like to install it? (y/n) " choice read -p "lm-sensors is not installed. Would you like to install it? (y/n) " choice
case "$choice" in case "$choice" in
@ -221,7 +220,7 @@ function uninstall_mod {
fi fi
# Remove the latest Nodes.pm file # Remove the latest Nodes.pm file
echo cp "$latest_Nodes_pm" "$nodespm" cp "$latest_Nodes_pm" "$nodespm"
echo "Copied latest backup to $nodespm" echo "Copied latest backup to $nodespm"
# Find the latest pvemanagerlib file using the find command # Find the latest pvemanagerlib file using the find command
@ -233,7 +232,7 @@ function uninstall_mod {
fi fi
# Remove the latest Nodes.pm file # Remove the latest Nodes.pm file
echo cp "$latest_pvemanagerlib_js" "$pvemanagerlib" cp "$latest_pvemanagerlib_js" "$pvemanagerlib"
echo "Copied latest backup to $pvemanagerlib" echo "Copied latest backup to $pvemanagerlib"
# Restart pveproxy # Restart pveproxy