summaryrefslogtreecommitdiff
path: root/ssh-hook.sh
blob: ee23dd48b0dca48a34d7b5d964fd89508f7e8d00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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