commit 32180cdf895c28089793ca996d0063aacd5fd833 Author: Johannes Randerath Date: Mon May 6 18:30:40 2024 +0200 Initial commit diff --git a/create_git.c b/create_git.c new file mode 100644 index 0000000..bb8bfa1 --- /dev/null +++ b/create_git.c @@ -0,0 +1,16 @@ +#include +#include + +int main(int argc, const char *argv[argc]) { + if (argc < 2) { + printf("Usage: create_git \n"); + return 1; + } + char *cmd = malloc(500); + sprintf(cmd, "ssh -t johannes@randerath.eu -i /home/johannes/.ssh/id_ed25519_git 'sudo install -vm755 -d /srv/git/%s.git && \ + sudo chown -Rv git:git /srv/git/%s.git && \ + cd /srv/git/%s.git && \ + sudo git config --system init.defaultBranch trunk'", argv[1], argv[1], argv[1]); + return system(cmd); +} +