switching from cachy to bazzite kernel

This commit is contained in:
tumillanino
2026-04-09 16:33:56 +10:00
parent 3f52e6286f
commit 57fdc02539
157 changed files with 6309 additions and 7 deletions

View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
IGNORE_MANUAL="wheel|root|sudo|nobody"
for manually_created_user in $(grep -E -e ".*:[1-3][[:digit:]]{3}:.*" "$1") ; do
# `grep` matched on a group with GID [1-3]000 or so
if [ ! -z "$(cut -f4 -d: <<< "${manually_created_user}")" ] ; then
continue
fi
IGNORE_MANUAL="$(cut -f1,3 -d: --output-delimiter="|" <<< "${manually_created_user}")|${IGNORE_MANUAL:-}"
for related_group in $(grep "$(cut -f1 -d: <<< ${manually_created_user})" "$1"); do
# Deduplicates matches for the same group/user
if [ "$(cut -f1 <<< "${related_group}")" == "$(cut -f1 <<< "${manually_created_user}")" ] ; then
continue
fi
IGNORE_MANUAL="$(cut -f1 -d: <<< "${related_group}")|${IGNORE_MANUAL:-}"
done
done
grep --no-filename -e "^g" /usr/lib/sysusers.d/*.conf | grep -v -E -e "${IGNORE_MANUAL}" | tr -s " " | cut -d" " -f2 | uniq | xargs -I{} sed -i "/{}/d" "${1}"