#!/bin/sh # gitcreate is part of the repo_shell distribution. eval $(sed -e 's| ||g' < /etc/repo_shell.conf) if [ -z "$owner" -o -z "$git_root" ]; then echo "$0: please configure /etc/repo_shell.conf" fi gitacls="$git_root/.gitacls" if [ "$(whoami)" != "$owner" ]; then echo "$0: must run as user $owner" >&2 exit 1 fi if [ $# -ne 1 ]; then echo "usage: $0 " >&2 exit 1 fi if [ -e $git_root/$1 ]; then echo "$0: repository $1 already exists" >&2 exit 1 fi # Create the respository umask 027 git --git-dir "$git_root/$1" init --bare [ $? -ne 0 ] && exit 1 [ -f "$gitacls" ] && echo "Check $gitacls for proper access permissions" echo "Repository created." [ ! -f "$gitacls" ] && echo "WARNING: $gitacls DOES NOT EXIST!" exit 0