V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 54s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 54s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -22,39 +22,85 @@ guard_sourcing
|
||||
check_pkgs() {
|
||||
### Declare Arrays, HashMaps, and Variables.
|
||||
# shellcheck disable=SC2154
|
||||
declare -A hmp_command_packages=(
|
||||
[apt-transport-https]=apt-transport-https
|
||||
[bzip2]=bzip2
|
||||
[ca-certificates]=ca-certificates
|
||||
[curl]=curl
|
||||
[expect]=expect
|
||||
[fdisk]=fdisk
|
||||
[gdisk]=gdisk
|
||||
[git]=git
|
||||
[gpg]=gnupg
|
||||
[lsb_release]=lsb-release
|
||||
[mkfs.btrfs]=btrfs-progs
|
||||
[mkfs.ext4]=e2fsprogs
|
||||
[mkfs.fat]=dosfstools
|
||||
[mkswap]=util-linux
|
||||
[mkfs.xfs]=xfsprogs
|
||||
[parted]=parted
|
||||
[pwgen]=pwgen
|
||||
[tar]=tar
|
||||
[wget]=wget
|
||||
[whois]=whois
|
||||
[xz]=xz-utils
|
||||
[yq]=yq
|
||||
declare -A hmp_tool_pkg=(
|
||||
[apt-show-versions]="apt-show-versions"
|
||||
[bc]="bc"
|
||||
[dig]="bind9-dnsutils"
|
||||
[host]="bind9-dnsutils"
|
||||
[hexdump]="bsdmainutils"
|
||||
[btrfs]="btrfs-progs"
|
||||
[bunzip2]="bzip2"
|
||||
[setupcon]="console-setup"
|
||||
[base64]="coreutils"
|
||||
[cat]="coreutils"
|
||||
[chmod]="coreutils"
|
||||
[chown]="coreutils"
|
||||
[cp]="coreutils"
|
||||
[echo]="coreutils"
|
||||
[ln]="coreutils"
|
||||
[mkdir]="coreutils"
|
||||
[curl]="curl"
|
||||
[dirmngr]="dirmngr"
|
||||
[dmsetup]="dmsetup"
|
||||
[fsck.vfat]="dosfstools"
|
||||
[mkfs.vfat]="dosfstools"
|
||||
[e2label]="e2fsprogs"
|
||||
[tune2fs]="e2fsprogs"
|
||||
[fsck]="e2fsprogs"
|
||||
[expect]="expect"
|
||||
[efibootmgr]="efibootmgr"
|
||||
[fdisk]="fdisk"
|
||||
[file]="file"
|
||||
[awk]="gawk"
|
||||
[gdisk]="gdisk"
|
||||
[gnupg]="gnupg"
|
||||
[grep]="grep"
|
||||
[gzip]="gzip"
|
||||
[haveged]="haveged"
|
||||
[update-initramfs]="initramfs-tools"
|
||||
[ip]="iproute2"
|
||||
[ping]="iputils-ping"
|
||||
[jq]="jq"
|
||||
[loadkeys]="kbd"
|
||||
[setfont]="kbd"
|
||||
[keyctl]="keyutils"
|
||||
[modprobe]="kmod"
|
||||
[libpam-pwquality]="libpam-pwquality"
|
||||
[logrotate]="logrotate"
|
||||
[lsb_release]="lsb-release"
|
||||
[parted]="parted"
|
||||
[chpasswd]="passwd"
|
||||
[chsh]="passwd"
|
||||
[lspci]="pciutils"
|
||||
[sysctl]="procps"
|
||||
[pwgen]="pwgen"
|
||||
[sed]="sed"
|
||||
[sudo]="sudo"
|
||||
[tar]="tar"
|
||||
[tree]="tree"
|
||||
[unzip]="unzip"
|
||||
[lsusb]="usbutils"
|
||||
[blkid]="util-linux"
|
||||
[dmesg]="util-linux"
|
||||
[lsblk]="util-linux"
|
||||
[findmnt]="util-linux"
|
||||
[mount]="util-linux"
|
||||
[umount]="util-linux"
|
||||
[xxd]="vim-common"
|
||||
[wget]="wget"
|
||||
[whois]="whois"
|
||||
[zsh]="zsh"
|
||||
[zstd]="zstd"
|
||||
)
|
||||
declare -a ary_missing_pkgs=() ary_unique_pkgs=()
|
||||
declare var_cmd=""
|
||||
declare var_bin=""
|
||||
|
||||
### Collecting missing binaries.
|
||||
for var_cmd in "${!hmp_command_packages[@]}"; do
|
||||
for var_bin in "${!hmp_tool_pkg[@]}"; do
|
||||
|
||||
if ! command -v "${var_cmd}" &>/dev/null; then
|
||||
if ! command -v "${var_bin}" &>/dev/null; then
|
||||
|
||||
ary_missing_pkgs+=("${hmp_command_packages[${var_cmd}]}")
|
||||
ary_missing_pkgs+=("${hmp_tool_pkg[${var_bin}]}")
|
||||
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user