I have a server running where I use php to run a bash script to verify certain information of a user. For example, I have a webhosting server set up, and in order to be able to
if id -nG "$USER" | grep -qw "$GROUP"; then echo $USER belongs to $GROUP else echo $USER does not belong to $GROUP fi
Explanation:
id -nG $USER
grep -qw $GROUP