You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
497 B
16 lines
497 B
#!/bin/bash
|
|
|
|
# Path to home directory of 'git' user on host
|
|
GIT_HOME=$HOME
|
|
|
|
# Path to Gitea 'git' home directory mounted on host
|
|
GITEA_HOME=$GIT_HOME/data/git
|
|
|
|
# Path to 'passthru' script on host
|
|
PASSTHRU_SCRIPT=$GIT_HOME/passthru
|
|
|
|
while read file; do
|
|
if [ "$file" == "authorized_keys" ]; then
|
|
sed "s#/app/gitea/gitea#$PASSTHRU_SCRIPT#g" $GITEA_HOME/.ssh/authorized_keys >$GIT_HOME/.ssh/authorized_keys
|
|
fi
|
|
done < <(exec inotifywait -mq -e close_write --format %f $GITEA_HOME/.ssh)
|
|
|