forked from Hyperion/HyperionOS
added users (spsf untangled by astronand)
This commit is contained in:
19
Src/Hyperion-bash/bin/lsusers
Normal file
19
Src/Hyperion-bash/bin/lsusers
Normal file
@@ -0,0 +1,19 @@
|
||||
--:Minify:--
|
||||
local users = syscall.auth_listusers()
|
||||
if not users or #users == 0 then
|
||||
print("No users found.")
|
||||
return
|
||||
end
|
||||
|
||||
syscall.devctl(1,"sfgc",13)
|
||||
print(string.format("%-6s %-6s %-16s %-20s %s", "UID", "GID", "Username", "Home", "Shell"))
|
||||
print(string.rep("-", 65))
|
||||
syscall.devctl(1,"sfgc",1)
|
||||
|
||||
for _, u in ipairs(users) do
|
||||
local lock_marker = u.locked and " [locked]" or ""
|
||||
if u.locked then syscall.devctl(1,"sfgc",2) end
|
||||
print(string.format("%-6d %-6d %-16s %-20s %s%s",
|
||||
u.uid, u.gid, u.username, u.homedir, u.shell, lock_marker))
|
||||
if u.locked then syscall.devctl(1,"sfgc",1) end
|
||||
end
|
||||
Reference in New Issue
Block a user