This repository has been archived on 2025-06-27. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
chkgrp/lua/test.lua

26 lines
538 B
Lua
Executable file

#!/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