diff options
| author | Trey Bastian <hello@treybastian.com> | 2025-10-30 10:55:56 +0000 |
|---|---|---|
| committer | Trey Bastian <hello@treybastian.com> | 2025-10-30 10:55:56 +0000 |
| commit | 739e849e108892884c5581464403726b482797a4 (patch) | |
| tree | dfc7b3bb963d2d06123582e49b9af8f384c0a47b | |
| parent | 839c8c87267aa43e592aebb7532ffec661836370 (diff) | |
moved some files around to better organiz, added new-repo git command
| -rwxr-xr-x | git-hooks/post-receive | 2 | ||||
| -rw-r--r-- | git-shell-commands/new-repo | 23 | ||||
| -rwxr-xr-x | git-shell-commands/no-interactive-login | 6 |
3 files changed, 30 insertions, 1 deletions
diff --git a/git-hooks/post-receive b/git-hooks/post-receive index 6445e0b..21c3503 100755 --- a/git-hooks/post-receive +++ b/git-hooks/post-receive @@ -28,4 +28,4 @@ echo "[$(date)] BEGIN PUSH $REPO_PATH" >> "$LOGFILE" git push --mirror "$REPO_URL" >> "$LOGFILE" 2>&1 echo "[$(date)] END PUSH $REPO_PATH" >> "$LOGFILE" -# vim: filetype=sh +# vim: filetype=bash diff --git a/git-shell-commands/new-repo b/git-shell-commands/new-repo new file mode 100644 index 0000000..66f822b --- /dev/null +++ b/git-shell-commands/new-repo @@ -0,0 +1,23 @@ +#!/bin/bash +# this script allows the creation of new repos over ssh on git server +# public repos will get a knot.conf containing the remote +# private repos will just exist on the server +# USAGE: +# ssh git@<host> new-repo +# - follow the prompts + +echo "oh look you are starting a project you won't finish again.\n" +read -p "whats this one called? " PROJECT_NAME +if [[ $PROJECT_NAME != *".git"* ]]; then + $PROJECT_NAME = "${PROJECT_NAME}.git" +fi +read -p "what's the remote(leave blank if private)" REMOTE_URL + +git --bare init "${PROJECT_NAME}" + +if [[ $REMOTE_URL ]]; then + touch "${PROJECT_NAME}/knot.conf" + echo "${REMOTE_URL}" >> "${PROJECT_NAME}/knot.conf" +fi + +#vim: filetype=bash diff --git a/git-shell-commands/no-interactive-login b/git-shell-commands/no-interactive-login new file mode 100755 index 0000000..53cc284 --- /dev/null +++ b/git-shell-commands/no-interactive-login @@ -0,0 +1,6 @@ +#!/bin/sh +pjintf '%s\n' "Hi $USER! You've successfully authenticated, but I do not" +printf '%s\n' "provide interactive shell access. Please go away now!" +exit 128 + +# vim: filetype=bash |
