mirror of
https://github.com/tumillanino/miasma-os.git
synced 2026-04-11 07:15:31 +00:00
switching from cachy to bazzite kernel
This commit is contained in:
19
docs/solarpowered-main/files/shared/usr/bin/rechunker-group-fix
Executable file
19
docs/solarpowered-main/files/shared/usr/bin/rechunker-group-fix
Executable 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}"
|
||||
Reference in New Issue
Block a user