fix the fail2ban issues and other things
shellcheck / shellcheck (push) Successful in 11s

This commit is contained in:
2026-10-31 08:10:05 -06:00
parent 17c1ba10f7
commit 6770150b11
19 changed files with 580 additions and 51 deletions
+24 -1
View File
@@ -10,13 +10,36 @@ is_group_installed() {
pacman -Qg "$1" &> /dev/null
}
# Packages and Flatpaks you don't want, one name per line (# starts a comment).
# install_packages and install-flatpaks.sh leave them out, so update doesn't
# put back what you've removed.
SKIP_PACKAGES="$HOME/.config/coredesktop/skip-packages"
# Print each argument that isn't in SKIP_PACKAGES, one per line
without_skipped() {
local -A skip=()
local name
if [ -f "$SKIP_PACKAGES" ]; then
while read -r name _; do
[[ -n "$name" && "$name" != \#* ]] && skip["$name"]=1
done < "$SKIP_PACKAGES"
fi
for name in "$@"; do
[ -n "${skip[$name]}" ] || echo "$name"
done
}
# Function to install packages if not already installed
install_packages() {
local packages=("$@")
local packages=()
local to_install=()
local as_deps=()
mapfile -t packages < <(without_skipped "$@")
# pacman -Qdq with no names would list every dependency on the system
[ ${#packages[@]} -ne 0 ] || return 0
for pkg in "${packages[@]}"; do
if ! is_installed "$pkg" && ! is_group_installed "$pkg"; then
to_install+=("$pkg")