diff options
author | Marco Capitani <m.capitani@nextworks.it> | 2017-06-13 09:45:15 +0200 |
---|---|---|
committer | Marco Capitani <m.capitani@nextworks.it> | 2017-06-13 09:45:15 +0200 |
commit | 3d16b92c65184d9a7c93a69d2b3393c528bf1dc6 (patch) | |
tree | 81898aa682d467147bc3117aadb16f1aa5dc787b /tools/rumba-access | |
parent | 57218e2bd37d32a9dafedde90a62b46955ac5e8f (diff) | |
parent | a5e67722327ecb2046798e6ad9a103fb42cb09e8 (diff) | |
download | rumba-3d16b92c65184d9a7c93a69d2b3393c528bf1dc6.tar.gz rumba-3d16b92c65184d9a7c93a69d2b3393c528bf1dc6.zip |
Merge branch 'master' into jfed-irati-fixes (rumba access)
Diffstat (limited to 'tools/rumba-access')
-rwxr-xr-x | tools/rumba-access | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/tools/rumba-access b/tools/rumba-access index 06b0a02..1cf382e 100755 --- a/tools/rumba-access +++ b/tools/rumba-access @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash FILE=ssh_info @@ -8,24 +8,33 @@ if [ "$MACHINE_ID" == "" ]; then exit 255 fi -USER=$(grep "\<${MACHINE_ID}\>" ${FILE} | awk '{print $2}') +USER=$(grep "\<${MACHINE_ID}\>" ${FILE} | awk -F';' '{print $2}') if [ "$USER" == "" ]; then echo "Error: Node ${MACHINE_ID} unknown" exit 255 fi -HOST=$(grep "\<${MACHINE_ID}\>" ${FILE} | awk '{print $3}') +HOST=$(grep "\<${MACHINE_ID}\>" ${FILE} | awk -F';' '{print $3}') if [ "$HOST" == "" ]; then echo "Error: Node ${MACHINE_ID} unknown" exit 255 fi -SSH_PORT=$(grep "\<${MACHINE_ID}\>" ${FILE} | awk '{print $4}') +SSH_PORT=$(grep "\<${MACHINE_ID}\>" ${FILE} | awk -F';' '{print $4}') if [ "$SSH_PORT" == "" ]; then echo "Error: Node ${MACHINE_ID} unknown" exit 255 fi +PROXY_CMD=$(grep "\<${MACHINE_ID}\>" ${FILE} | awk -F';' '{print $5}') +if [ "$PROXY_CMD" == "" ]; then + echo "Error: Node ${MACHINE_ID} unknown" + exit 255 +fi + echo "Accessing Rumba node ${MACHINE_ID}" -# -o IdentityFile=buildroot/irati_rsa -ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p ${SSH_PORT} ${USER}@${HOST} +if [[ $PROXY_CMD = "None" ]]; then + ssh -A -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p ${SSH_PORT} ${USER}@${HOST} +else + ssh -A -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -oProxyCommand="$PROXY_CMD" -p ${SSH_PORT} ${USER}@${HOST} +fi |