This commit is contained in:
Executable
+41
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env bash
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
# shellcheck source=00-platform-guard.inc
|
||||
source "$SCRIPT_DIR/00-platform-guard.inc"
|
||||
|
||||
packages=(
|
||||
curl wget git vim nano tmux byobu htop btop glances
|
||||
jq unzip zip rsync tree ncdu duf
|
||||
lsof strace tcpdump nmap dnsutils net-tools iperf3 ethtool
|
||||
smartmontools nvme-cli lm-sensors pciutils usbutils hwinfo
|
||||
sysstat iotop iftop nload
|
||||
ca-certificates gnupg software-properties-common apt-transport-https
|
||||
needrestart unattended-upgrades logrotate
|
||||
)
|
||||
|
||||
if ((EUID != 0)); then
|
||||
printf 'CRITICAL: base package setup must run as root\n' >&2
|
||||
exit 2
|
||||
fi
|
||||
require_supported_ubuntu
|
||||
if ! command -v apt-get >/dev/null 2>&1; then
|
||||
printf 'CRITICAL: apt-get is required\n' >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
printf 'INFO: refreshing APT metadata\n'
|
||||
apt-get update
|
||||
printf 'INFO: installing baseline operational packages\n'
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y "${packages[@]}"
|
||||
|
||||
if command -v systemctl >/dev/null 2>&1; then
|
||||
systemctl enable --now sysstat
|
||||
else
|
||||
printf 'WARNING: systemctl is unavailable; sysstat was not enabled\n'
|
||||
fi
|
||||
|
||||
printf 'OK: baseline operational packages are installed\n'
|
||||
Reference in New Issue
Block a user