aboutsummaryrefslogtreecommitdiff
path: root/tools/rumba-access
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2017-06-07 11:27:22 +0200
committerSander Vrijders <sander.vrijders@ugent.be>2017-06-07 11:27:22 +0200
commitdcb7c8743244b4010db159d7d8d794278a792b17 (patch)
tree746c6ab2fe8e7b4b40a7a8474c8a5ca46660f532 /tools/rumba-access
parentdb18f01116739a2854c4305a7ad72da8c56d446d (diff)
downloadrumba-dcb7c8743244b4010db159d7d8d794278a792b17.tar.gz
rumba-dcb7c8743244b4010db159d7d8d794278a792b17.zip
tools: Update access script to use proxy
The proxy command was not added to the file generated with ssh info. This adds it, and changes the access script to use it if it is there.
Diffstat (limited to 'tools/rumba-access')
-rwxr-xr-xtools/rumba-access20
1 files changed, 15 insertions, 5 deletions
diff --git a/tools/rumba-access b/tools/rumba-access
index 06b0a02..4c77d2b 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,34 @@ 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