I am trying to create a script that will run as root and add the logged in user to the lpadmin group upon first login.

This is what I have so far:


if groups $USER | grep -q -E ' lpadmin(\s|$)'; then
    #echo $USER" is already in the group lpadmin"
    #echo $USER" is NOT in the group lpadmin"
    sudo useradd -G lpadmin $USER
Are there additional commands that need to be entered to make this happen? Any tips are welcome.