Files
cdba/shell/update
Bjorn Andersson ffc91a6bf2 cdba-shell: Add some simple scripts for user maintenance
Introduce some scripts to allow storing users public keys in a git and
some hooks such that when this is pushed to the server the
authorized_keys file is re-generated.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2022-08-18 23:07:40 -05:00

19 lines
291 B
Bash

#!/bin/sh
refname="$1"
oldrev="$2"
newrev="$3"
if [ "$refname" != "refs/heads/main" ]; then
echo "Only refs/heads/main allowed"
exit 1
fi
zero=$(git hash-object --stdin </dev/null | tr '[0-9a-f]' '0')
if [ "$newrev" = "$zero" ]; then
echo "Don't delete main branch"
exit 1
fi
exit 0