X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=src%2Fshare%2Fcommon;h=76b539f4ab89dc9ddd8d585a751f64ed4f514430;hb=ba3ca3e10f4975510dfeedcb6dfe8e2374ca3097;hp=bd887d39b410d333badc6048b08d5e777322ce4b;hpb=3e5df3def466a61cd32bdcc1fd29da09dff43729;p=monkeysphere.git diff --git a/src/share/common b/src/share/common index bd887d3..76b539f 100644 --- a/src/share/common +++ b/src/share/common @@ -483,6 +483,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