Files
VPS-scripts_Unattended-Secu…/installer.sh
2020-10-01 12:14:29 +02:00

40 lines
1.0 KiB
Bash

#!/bin/bash
###############################
# @author: Bram Prieshof #
# @author: Branco van de Waal #
###############################
##--------------##
# Pre-Config #
##--------------##
if [ -z "$PKGI" ] || [ -z "$PKGM" ]
then
PKGM="apt"
PKGI="${PKGM} install -y"
fi
$PKGM update
##-------------##
# Installer #
##-------------##
$PKGI unattended-upgrades
##----------------##
# OS Detection #
##----------------##
source /etc/os-release
if [ "$ID" = "debian" ]; then
LinVer=Debian
elif [ "$ID" = "ubuntu" ]; then
LinVer=Ubuntu
else
echo "this OS is not supported"
fi
##-----------##
# Configs #
##-----------##
curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/Unattended-Security-Updates/raw/branch/master/config/Universal_20auto-upgrades -o /etc/apt/apt.conf.d/20auto-upgrades
curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/Unattended-Security-Updates/raw/branch/master/config/"$LinVer"_50unattended-upgrades -o /etc/apt/apt.conf.d/50unattended-upgrades