]> WPIA git - infra.git/blobdiff - manager/fetch
upd: cleanup inclusion of config and document config elements
[infra.git] / manager / fetch
index 184e4889c7245a1bd916da234427857b89d1a273..7e7f1e1c400a4168fcd3277761b229457c3040e3 100755 (executable)
@@ -1,10 +1,8 @@
 #!/bin/bash
-function ssh_target {
-    ssh -i vm-key "$to" "$@"
-}
-target=$1
-target=${target%/}
-source "$target/config"
+targetHost=$1
+targetHost=${targetHost%/}
+source config
+source "$targetHost/config"
 
 echo "To: $to"
 echo "Agent: $SSH_AGENT_PID"
@@ -18,7 +16,7 @@ echo "Action: $command"
 if [[ $command == "push" ]]; then
     git push -f "$to:" "HEAD:refs/remotes/manager/master"
 else
-    git fetch "$to:" "+HEAD:refs/remotes/$target/master"
+    git fetch "$to:" "+HEAD:refs/remotes/$targetHost/master"
 fi
 if [[ $oldpid == "" ]]; then
     eval $(ssh-agent -k)