From 9ddd0833ef62e84b1651201b1982899c740c9b75 Mon Sep 17 00:00:00 2001 From: Anthony Wang Date: Sun, 15 Dec 2024 21:34:28 -0500 Subject: Handle systemd-sysusers's new u! feature for locking accounts using regex to match starting with u --- fish/functions/sysusers.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fish/functions/sysusers.fish b/fish/functions/sysusers.fish index eef7b11..81eb9b8 100644 --- a/fish/functions/sysusers.fish +++ b/fish/functions/sysusers.fish @@ -1,4 +1,4 @@ function sysusers - diff (awk -F: '$3 < 1000 {print $1}' /etc/passwd | sort | psub) (systemd-sysusers --tldr | awk '$1 == "u" {print $2}' | grep -v nobody | sort | psub) - diff (awk -F: '$3 < 1000 {print $1}' /etc/group | sort | psub) (systemd-sysusers --tldr | awk '$1 == "u" || $1 == "g" {print $2}' | grep -v nobody | sort | uniq | psub) + diff (awk -F: '$3 < 1000 {print $1}' /etc/passwd | sort | psub) (systemd-sysusers --tldr | awk '$1 ~ /^u/ {print $2}' | grep -v nobody | sort | psub) + diff (awk -F: '$3 < 1000 {print $1}' /etc/group | sort | psub) (systemd-sysusers --tldr | awk '$1 ~ /^u/ || $1 ~ /^g/ {print $2}' | grep -v nobody | sort | uniq | psub) end -- cgit v1.2.3-70-g09d2