Merged with chkgrp and renamed to chkusr.
This commit is contained in:
parent
b2461ba7a0
commit
8644ccbdc5
12 changed files with 779 additions and 22 deletions
26
lua/test.lua
Executable file
26
lua/test.lua
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/env lua
|
||||
|
||||
-- This file is part of chkgrp that is a program that checks if a user is a
|
||||
-- member of a group.
|
||||
--
|
||||
-- Author: Johannes Findeisen <you@hanez.org> - 2025
|
||||
-- Homepage: https://git.xw3.org/hanez/chkgrp
|
||||
-- License: Apache-2.0 (see LICENSE)
|
||||
|
||||
local checkgroup = require("checkgroup")
|
||||
|
||||
local user = arg[1]
|
||||
local group = arg[2]
|
||||
|
||||
local result = checkgroup.is_user_in_group(user, group)
|
||||
|
||||
if result == true then
|
||||
print("Yes")
|
||||
os.exit(0)
|
||||
elseif result == false then
|
||||
print("No")
|
||||
os.exit(1)
|
||||
else
|
||||
os.exit(2)
|
||||
end
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue