Files
build/lib/functions/host/basic-deps.sh
Ash 408bc67619 Add shebangs for shellcheck (#4493)
* Add shebangs for shellcheck

See #AR-1406

* Add shebangs for shellcheck

Also for `extensions` scripts
2022-11-27 21:44:50 +01:00

31 lines
738 B
Bash

#!/usr/bin/env bash
# prepare_host_basic
#
# * installs only basic packages
#
prepare_host_basic() {
# command:package1 package2 ...
# list of commands that are neeeded:packages where this command is
local check_pack install_pack
local checklist=(
"dialog:dialog"
"fuser:psmisc"
"getfacl:acl"
"uuid:uuid uuid-runtime"
"curl:curl"
"gpg:gnupg"
"gawk:gawk"
)
for check_pack in "${checklist[@]}"; do
if ! which ${check_pack%:*} > /dev/null; then local install_pack+=${check_pack#*:}" "; fi
done
if [[ -n $install_pack ]]; then
display_alert "Updating and installing basic packages on host" "$install_pack"
sudo bash -c "apt-get -qq update && apt-get install -qq -y --no-install-recommends $install_pack"
fi
}