diff options
Diffstat (limited to 'gitjoe-newrepo.pl')
-rwxr-xr-x | gitjoe-newrepo.pl | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gitjoe-newrepo.pl b/gitjoe-newrepo.pl index dc91e6e..d90993c 100755 --- a/gitjoe-newrepo.pl +++ b/gitjoe-newrepo.pl @@ -16,6 +16,37 @@ sub main { my $usr = $ARGV[0]; my $repo = $ARGV[1]; my $home_dir = '/usr/home/' . $usr . '/'; + if (substr($repo, -4) ne '.git') { + $repo = $repo . '.git'; + } + $repo = $repo . '/'; + system( + '/usr/local/bin/dash', + '-c', + '/bin/mkdir -v ' . $home_dir . $repo + ); + system( + '/usr/local/bin/dash', + '-c', + '/usr/local/bin/git -C ' . $home_dir . $repo . ' init --bare' + ); + system( + '/usr/local/bin/dash', + '-c', + '/usr/sbin/chown -v -R ' . $usr . ':' . $usr . ' ' . $home_dir . $repo + ); + system( + '/usr/local/bin/dash', + '-c', + '/usr/bin/touch -v ' . $home_dir . $repo . 'git-daemon-export-ok' + ); + system( + '/usr/local/bin/dash', + '-c', + '/usr/sbin/chown -v ' . $usr . ':' . $usr . ' ' . $home_dir . $repo . 'git-daemon-export-ok' + ); + system( + ); exit; } |