]> WPIA git - infra.git/blob - manager/fetch
809b1bf0ffe6689a724a1edaf102e85e2d240e6f
[infra.git] / manager / fetch
1 #!/bin/bash
2 function ssh_target {
3     ssh -i vm-key "$to" "$@"
4 }
5 source "$1/config"
6
7 echo "To: $to"
8 echo "Agent: $SSH_AGENT_PID"
9 oldpid=$SSH_AGENT_PID
10 if [[ $oldpid == "" ]]; then
11     eval $(ssh-agent)
12     ssh-add vm-key
13 fi
14
15 git fetch "$to:" "HEAD:refs/remotes/$1"
16
17 if [[ $oldpid == "" ]]; then
18     eval $(ssh-agent -k)
19 fi
20