aboutsummaryrefslogtreecommitdiffstats
path: root/gitjoe-newrepo.pl
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-07-06 17:46:36 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-07-06 17:46:36 +0200
commit3d166772f80be08b8d1aeb7cd48078fbee9b7e84 (patch)
tree0268336760c55620d49d97661e3a35f3249e90e5 /gitjoe-newrepo.pl
parentNew script for new repo (diff)
downloadjoe-scripts-3d166772f80be08b8d1aeb7cd48078fbee9b7e84.tar.gz
joe-scripts-3d166772f80be08b8d1aeb7cd48078fbee9b7e84.tar.bz2
joe-scripts-3d166772f80be08b8d1aeb7cd48078fbee9b7e84.tar.xz
joe-scripts-3d166772f80be08b8d1aeb7cd48078fbee9b7e84.tar.zst
joe-scripts-3d166772f80be08b8d1aeb7cd48078fbee9b7e84.zip
Trying the newrepo script
Diffstat (limited to 'gitjoe-newrepo.pl')
-rwxr-xr-xgitjoe-newrepo.pl31
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;
}