aboutsummaryrefslogtreecommitdiff
path: root/home
diff options
context:
space:
mode:
Diffstat (limited to 'home')
-rwxr-xr-xhome/install_keys.sh17
-rwxr-xr-xhome/list.sh3
-rwxr-xr-xhome/update.sh2
3 files changed, 19 insertions, 3 deletions
diff --git a/home/install_keys.sh b/home/install_keys.sh
new file mode 100755
index 0000000..b722038
--- /dev/null
+++ b/home/install_keys.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+# Useful for generating git-only authorized keys.
+# If say you don't want to enable shell access for all of your git users.
+# Note, that this doesn't prevent people from deleting branches, force
+# pushing and such.
+boiler='no-port-forwarding,no-agent-forwarding,command="git-shell -c \"$SSH_ORIGINAL_COMMAND\""'
+
+if [ -z "$1" ] ; then
+ echo "You need to supply an argument which contains a set of authorized_keys files"
+ exit 1;
+fi
+
+IFS="
+"
+for key in $(cat "$@" | sed -e'/^#/d' ) ; do
+ printf "%s %s\n" "$boiler" "$key"
+done
diff --git a/home/list.sh b/home/list.sh
index b3b8bd9..592a4a3 100755
--- a/home/list.sh
+++ b/home/list.sh
@@ -1,10 +1,9 @@
#!/bin/sh
#shellcheck disable=SC2038
-find . -type f -name HEAD \
+find * -type f -name HEAD \
| xargs -n1 dirname \
| while read -r repo ; do
if ! [ "$(basename "$repo")" = ".git" ] ; then
echo "$repo";
fi
done
-
diff --git a/home/update.sh b/home/update.sh
index a51490f..a484fcc 100755
--- a/home/update.sh
+++ b/home/update.sh
@@ -6,6 +6,6 @@ set -x
$HOME/list.sh \
| while read -r repo ; do
cd "$repo"
- git repack
+ git update-server-info
cd -
done