X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=src%2Fshare%2Fcommon;h=8e2232d659350558e472bd5f37c365d050317b8d;hb=adef51285ea488ecda7b0a77b142d99e022d9e10;hp=c88857e44adabca90d57bb02358bcce92d16f67d;hpb=a2704823c7770bc8df9377116877fcca78c3ea12;p=monkeysphere.git diff --git a/src/share/common b/src/share/common index c88857e..8e2232d 100644 --- a/src/share/common +++ b/src/share/common @@ -484,6 +484,12 @@ get_homedir() { eval "echo ~${uname}" } +# return the primary group of a user +get_primary_group() { + local uname=${1:-`whoami`} + groups "$uname" | sed 's/^..* : //' | awk '{ print $1 }' +} + ### CONVERSION UTILITIES # output the ssh key for a given key ID