summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Wang2024-12-15 21:34:28 -0500
committerAnthony Wang2024-12-15 21:34:28 -0500
commit9ddd0833ef62e84b1651201b1982899c740c9b75 (patch)
tree1b02bb94b5a22b419692d1998d636649f9df98a1
parentd8fb76e3d5d48eb8f64d07e01d5a05cd3c704cfd (diff)
Handle systemd-sysusers's new u! feature for locking accounts using regex to match starting with u
-rw-r--r--fish/functions/sysusers.fish4
1 files 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