diff options
author | Zhongheng Liu <z.liu@outlook.com.gr> | 2024-12-22 16:24:44 +0200 |
---|---|---|
committer | Zhongheng Liu <z.liu@outlook.com.gr> | 2024-12-22 16:24:44 +0200 |
commit | ccbeff158711842f2c0b9320ee3f13f390e1b1ca (patch) | |
tree | f9aa67ee36951d23e5457dee63a93b77d393222d | |
download | homelab-util-scripts-ccbeff158711842f2c0b9320ee3f13f390e1b1ca.tar.gz homelab-util-scripts-ccbeff158711842f2c0b9320ee3f13f390e1b1ca.tar.bz2 homelab-util-scripts-ccbeff158711842f2c0b9320ee3f13f390e1b1ca.zip |
feat: first homelab shell script
-rwxr-xr-x | git_create_shared_git_repo.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/git_create_shared_git_repo.sh b/git_create_shared_git_repo.sh new file mode 100755 index 0000000..b550a4e --- /dev/null +++ b/git_create_shared_git_repo.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env sh + +# Used in home server setup. +# +# +GIT_BASE_PATH="/srv/git" + +path="$GIT_BASE_PATH/$1" +prev="$(pwd)" +echo "Creating directory in $path" +mkdir -p "$path" +cd "$path" || return +echo "Setting up git files in $path" +git init --bare --shared +git config --file config http.receivepack true +echo "Completed setup, returning to $prev" +cd "$prev" || return +echo "done" |