|
|
|
@@ -3,7 +3,7 @@
|
|
|
|
###### CONFIG SECTION ######
|
|
|
|
###### CONFIG SECTION ######
|
|
|
|
|
|
|
|
|
|
|
|
# Define basic tools to install
|
|
|
|
# Define basic tools to install
|
|
|
|
TOOLS="sudo vim ifupdown2 libpve-network-perl net-tools dnsutils ethtool git curl unzip screen iftop lshw smartmontools nvme-cli lsscsi sysstat zfs-auto-snapshot htop mc rpl lsb-release"
|
|
|
|
TOOLS="sudo vim ifupdown2 libpve-network-perl net-tools dnsutils ethtool git curl unzip screen tmux iftop lshw smartmontools nvme-cli lsscsi sysstat zfs-auto-snapshot htop mc rpl lsb-release"
|
|
|
|
|
|
|
|
|
|
|
|
#### PVE CONF BACKUP CONFIGURATION ####
|
|
|
|
#### PVE CONF BACKUP CONFIGURATION ####
|
|
|
|
|
|
|
|
|
|
|
|
@@ -11,7 +11,7 @@ TOOLS="sudo vim ifupdown2 libpve-network-perl net-tools dnsutils ethtool git cur
|
|
|
|
# IMPORTANT NOTE: Don't type in the leading /, this will be set where needed
|
|
|
|
# IMPORTANT NOTE: Don't type in the leading /, this will be set where needed
|
|
|
|
PVE_CONF_BACKUP_TARGET=rpool/pveconf
|
|
|
|
PVE_CONF_BACKUP_TARGET=rpool/pveconf
|
|
|
|
|
|
|
|
|
|
|
|
# Define timer for your backup cronjob (default: every 15 minutes fron 3 through 59)
|
|
|
|
# Define timer for your backup cronjob (default: every 15 minutes from 3 through 59)
|
|
|
|
PVE_CONF_BACKUP_CRON_TIMER="3,18,33,48 * * * *"
|
|
|
|
PVE_CONF_BACKUP_CRON_TIMER="3,18,33,48 * * * *"
|
|
|
|
|
|
|
|
|
|
|
|
# Get Debian version info
|
|
|
|
# Get Debian version info
|
|
|
|
@@ -99,7 +99,7 @@ fi
|
|
|
|
echo -e "######## CONFIGURE SWAPPINESS ########\n"
|
|
|
|
echo -e "######## CONFIGURE SWAPPINESS ########\n"
|
|
|
|
SWAPPINESS=$(cat /proc/sys/vm/swappiness)
|
|
|
|
SWAPPINESS=$(cat /proc/sys/vm/swappiness)
|
|
|
|
echo "The current swappiness is configured to '$SWAPPINESS %' of free memory until using swap."
|
|
|
|
echo "The current swappiness is configured to '$SWAPPINESS %' of free memory until using swap."
|
|
|
|
read -p "If you want to change the swappiness, please type in the percentage as number (0 = diasbled):" user_input
|
|
|
|
read -p "If you want to change the swappiness, please type in the percentage as number (0 = disabled):" user_input
|
|
|
|
if echo "$user_input" | grep -qE '^[0-9]+$'; then
|
|
|
|
if echo "$user_input" | grep -qE '^[0-9]+$'; then
|
|
|
|
echo "Changing swappiness from '$SWAPPINESS %' to '$user_input %'"
|
|
|
|
echo "Changing swappiness from '$SWAPPINESS %' to '$user_input %'"
|
|
|
|
SWAPPINESS=$user_input
|
|
|
|
SWAPPINESS=$user_input
|
|
|
|
@@ -137,7 +137,7 @@ for interval in "${!auto_snap_keep[@]}"; do
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
#### CHECKMK AGENT CONFIGURATION ####
|
|
|
|
#### CHECKMK AGENT CONFIGURATION ####
|
|
|
|
read -p "Do you want to install checkmk agent of this machine? [y/N] " install_checkmk
|
|
|
|
read -p "Do you want to install checkmk agent on this machine? [y/N] " install_checkmk
|
|
|
|
if [[ "$install_checkmk" == "y" ]]; then
|
|
|
|
if [[ "$install_checkmk" == "y" ]]; then
|
|
|
|
read -p "Please specify the base url to your checkmk server (e.g. https://check.zmb.rocks/bashclub): " cmk_agent_url
|
|
|
|
read -p "Please specify the base url to your checkmk server (e.g. https://check.zmb.rocks/bashclub): " cmk_agent_url
|
|
|
|
read -p "Enable agent encryption (requires setup of Agent Encryption on your checkmk instance). Do you want to activate agent encryption? [y/N] " cmk_encrypt
|
|
|
|
read -p "Enable agent encryption (requires setup of Agent Encryption on your checkmk instance). Do you want to activate agent encryption? [y/N] " cmk_encrypt
|
|
|
|
@@ -165,7 +165,12 @@ fi
|
|
|
|
###### INSTALLER SECTION ######
|
|
|
|
###### INSTALLER SECTION ######
|
|
|
|
|
|
|
|
|
|
|
|
# disable pve-enterprise repo and add pve-no-subscription repo
|
|
|
|
# disable pve-enterprise repo and add pve-no-subscription repo
|
|
|
|
if [[ "$(uname -r)" == *"-pve" ]]; then
|
|
|
|
|
|
|
|
|
|
|
|
#Not tested, yet!
|
|
|
|
|
|
|
|
read -p "Do you want to disable pve-enterprise repo and add pve-no-subscription repo (y/N)? " response
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ "${response,,}" == "y" ]; then
|
|
|
|
|
|
|
|
if [[ "$(uname -r)" == *"-pve" ]]; then
|
|
|
|
echo "Deactivating pve-enterprise repository"
|
|
|
|
echo "Deactivating pve-enterprise repository"
|
|
|
|
mv /etc/apt/sources.list.d/pve-enterprise.list /etc/apt/sources.list.d/pve-enterprise.list.bak > /dev/null 2>&1
|
|
|
|
mv /etc/apt/sources.list.d/pve-enterprise.list /etc/apt/sources.list.d/pve-enterprise.list.bak > /dev/null 2>&1
|
|
|
|
echo "Activating pve-no-subscription repository"
|
|
|
|
echo "Activating pve-no-subscription repository"
|
|
|
|
@@ -174,7 +179,9 @@ if [[ "$(uname -r)" == *"-pve" ]]; then
|
|
|
|
echo "deb http://download.proxmox.com/debian/pve $VERSION_CODENAME pve-no-subscription" >> /etc/apt/sources.list
|
|
|
|
echo "deb http://download.proxmox.com/debian/pve $VERSION_CODENAME pve-no-subscription" >> /etc/apt/sources.list
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
rm -f /etc/apt/sources.list.d/pve-no-subscription.list
|
|
|
|
rm -f /etc/apt/sources.list.d/pve-no-subscription.list
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
echo "Getting latest package lists"
|
|
|
|
echo "Getting latest package lists"
|
|
|
|
apt update > /dev/null 2>&1
|
|
|
|
apt update > /dev/null 2>&1
|
|
|
|
|
|
|
|
|
|
|
|
@@ -229,8 +236,8 @@ echo $ZFS_ARC_MIN_BYTES > /sys/module/zfs/parameters/zfs_arc_min
|
|
|
|
echo $ZFS_ARC_MAX_BYTES > /sys/module/zfs/parameters/zfs_arc_max
|
|
|
|
echo $ZFS_ARC_MAX_BYTES > /sys/module/zfs/parameters/zfs_arc_max
|
|
|
|
|
|
|
|
|
|
|
|
cat << EOF > /etc/modprobe.d/zfs.conf
|
|
|
|
cat << EOF > /etc/modprobe.d/zfs.conf
|
|
|
|
options zfs zfs_arc_min=$ZFS_ARC_MIN_BYTES
|
|
|
|
|
|
|
|
options zfs zfs_arc_max=$ZFS_ARC_MAX_BYTES
|
|
|
|
options zfs zfs_arc_max=$ZFS_ARC_MAX_BYTES
|
|
|
|
|
|
|
|
options zfs zfs_arc_min=$ZFS_ARC_MIN_BYTES
|
|
|
|
EOF
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
|
|
if [[ "$install_checkmk" == "y" ]]; then
|
|
|
|
if [[ "$install_checkmk" == "y" ]]; then
|
|
|
|
|