commit bfb37f5b2e763a5e764f9c6d808339cf4fac7040
parent 8afd2755b983911dbed4b06f1cd86eea4f14c42b
Author: parazyd <parazyd@dyne.org>
Date: Sun, 22 May 2022 14:49:39 +0200
contrib: Update gen_rules.sh
Diffstat:
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/contrib/gen_rules.sh b/contrib/gen_rules.sh
@@ -4,7 +4,16 @@ misc="no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty"
gen_for_keys() {
while read -r key; do
- printf "command=\"/usr/bin/git-restrict %s\",%s %s\n" "$@" "$misc" "$key"
+ if echo "$key" | grep -q '#'; then
+ continue
+ fi
+
+ if [ -z "$key" ]; then
+ continue
+ fi
+
+ printf 'command="/usr/local/bin/git-restrict %s",%s %s\n' \
+ "$@" "$misc" "$key"
done
}