git-serv

All-in-one Git hosting container

git clone git://git.janzachar.dev/git-serv.git


0#!/bin/sh
1
2#shellcheck source=config/env
3. "/srv/config/env"
4
5usage() {
6	echo "usage: link <name>"
7	echo "  prints repo link for cloning"
8	echo "  example: link test"
9	exit 1
10}
11
12[ $# -ne 1 ] && usage
13
14REPO="/repos/${1}.git"
15
16[ ! -d "$REPO" ] && {
17	echo "'${1}' does not exist!"
18	exit 1
19}
20
21echo "ssh://$GIT_USER@$HOSTNAME:$PORT$REPO"
22
23