diff options
-rwxr-xr-x | ssh-hook.sh | 18 | ||||
-rw-r--r-- | ssh_authorized_keys | 1 |
2 files changed, 19 insertions, 0 deletions
diff --git a/ssh-hook.sh b/ssh-hook.sh new file mode 100755 index 0000000..ee23dd4 --- /dev/null +++ b/ssh-hook.sh @@ -0,0 +1,18 @@ +#!/bin/sh +# Fetch cnf in build and export ssh config +if [ -z "$SSH_ORIGINAL_COMMAND" ]; then + + echo "Pull Laminar config" + cd "$(dirname "$(readlink -f "$0")")" + git fetch --prune --force https://git.cynerd.cz/laminar-cnf master:master + git reset --hard origin/master + + echo "Deploy authorized keys" + cp ssh_authorized_keys ~/.ssh/authorized_keys + +else + + echo "Laminar queue: $SSH_ORIGINAL_COMMAND" + laminarc queue "$SSH_ORIGINAL_COMMAND" + +fi diff --git a/ssh_authorized_keys b/ssh_authorized_keys new file mode 100644 index 0000000..2045cc6 --- /dev/null +++ b/ssh_authorized_keys @@ -0,0 +1 @@ +restrict,command="~/cfg/ssh-hook.sh" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCuiylOhJaLHuoYleeIqXw0DeYI+DHp7z6LyWa5gVhV+DgHEOwra9SfrKwDKRlu/uDNbwuMzI4XE2Y3rXp6Fx/Ujh4+yrqCCJKdMFJt60iftys7Ilb+H0ihyrnhGCVFr214GDOjF94llkbHIYqSm3LcXdN9Xs2koPM0kq2+LZGMQ5Q9nc0gDGztiTArn9WfQsclu5OZhrWFfwUIwyI0wITHTMrMSNBL8mt/sKjGCNcRv/zg8FaLnB+GNjkA6jrzw3qLyguS0DUWszX4NlgkAd3KxhVoonnrhh35EAdZXtChT3g9zE42xgfbE3houkuRYA4YpJOJfYi1O+oLz40N/lKt git hook build key |