Skip to content

Instantly share code, notes, and snippets.

@halkeye
Created November 27, 2011 03:02
Show Gist options
  • Save halkeye/1396870 to your computer and use it in GitHub Desktop.
Save halkeye/1396870 to your computer and use it in GitHub Desktop.
Script to generate project.list per user
#!/bin/sh
# https://gist.github.com/1396870
for i in $( grep gl-auth-command ~/.ssh/authorized_keys | awk '{print $2}' | awk -F'"' '{print $1}' | sort | uniq); do
/home/git/bin/gl-auth-command $i get-perms | sed 's/\r//' | awk '{if ($1 ~ /R/) { print $3 ".git"; }}' > /home/git/projects.list.$i;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment