diff options
Diffstat (limited to 'add-git-user')
-rwxr-xr-x | add-git-user | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/add-git-user b/add-git-user index 1f5eec1..84660cb 100755 --- a/add-git-user +++ b/add-git-user @@ -63,6 +63,21 @@ printf '%s\\n\\n' "provide interactive shell access." exit 128 EOF chmod +x $nolog + +### Create the read-only script +readonly=$gitshdir/read-only +cat > $readonly <<EOF +#!/bin/bash +read -a tokens <<< "\$SSH_ORIGINAL_COMMAND" +if [ "\${tokens[0]}" != git-receive-pack ] ; then + exec git-shell -c "\$SSH_ORIGINAL_COMMAND" +else + exit 128 +fi +EOF +chmod +x $readonly + +### Adjust owner of git-shell-commands directory chown -R $user:$user $gitshdir ### Initialize the SSH directory |