From 44e07caa905d14a8a709b993c4e7ac93570b97e8 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Tue, 7 Jul 2020 19:35:48 +0200 Subject: Better newrepo script, with owner and url files support --- gitjoe-newrepo.pl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'gitjoe-newrepo.pl') diff --git a/gitjoe-newrepo.pl b/gitjoe-newrepo.pl index 77651c4..bedb9e2 100755 --- a/gitjoe-newrepo.pl +++ b/gitjoe-newrepo.pl @@ -45,6 +45,22 @@ sub main { '-c', '/usr/sbin/chown -v ' . $usr . ':' . $usr . ' ' . $home_dir . $repo . 'git-daemon-export-ok' ); + open(my $owner_fh, '>:encoding(utf-8)', $home_dir . $repo . 'owner'); + print $owner_fh $usr; + close($owner_fh); + system( + '/usr/local/bin/dash', + '-c', + '/usr/sbin/chown -v ' . $usr . ':' . $usr . ' ' . $home_dir . $repo . 'owner' + ); + open(my $url_fh, '>:encoding(utf-8)', $home_dir . $repo . 'url'); + print $url_fh 'git://jozanleclerc.xyz/' . $usr . '/' . chomp($repo); + close($url_fh); + system( + '/usr/local/bin/dash', + '-c', + '/usr/sbin/chown -v ' . $usr . ':' . $usr . ' ' . $home_dir . $repo . 'url' + ); exit; } -- cgit v1.2.3