Created
April 1, 2020 02:49
-
-
Save tom-butler/6ff5f6749aab570fce52bf80479c2ba6 to your computer and use it in GitHub Desktop.
Finds missing gid and creates a new group for it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# get error messages from groups | |
g=$(groups 2>&1 > /dev/null) | |
if [ -z "${g}" ]; then | |
# pull gid from error message | |
gid=${g/groups: cannot find name for group ID/} | |
# create a group with the missing gid | |
groupadd --gid "$gid" efs | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment