aboutsummaryrefslogtreecommitdiff
path: root/tools/rumba-access
diff options
context:
space:
mode:
authorVincenzo Maffione <v.maffione@gmail.com>2017-06-07 10:04:07 +0200
committerVincenzo Maffione <v.maffione@gmail.com>2017-06-07 10:11:01 +0200
commit1e179fc8058f7bbcea7b6a681726796b4ffe9748 (patch)
tree6752a9cb2c7e08328f82097c941b071359206457 /tools/rumba-access
parentacd8339aeaff05d678c3663b0a36af9e73fda618 (diff)
downloadrumba-1e179fc8058f7bbcea7b6a681726796b4ffe9748.tar.gz
rumba-1e179fc8058f7bbcea7b6a681726796b4ffe9748.zip
rumba: add initial version of rumba-access
Diffstat (limited to 'tools/rumba-access')
-rwxr-xr-xtools/rumba-access31
1 files changed, 31 insertions, 0 deletions
diff --git a/tools/rumba-access b/tools/rumba-access
new file mode 100755
index 0000000..06b0a02
--- /dev/null
+++ b/tools/rumba-access
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+FILE=ssh_info
+
+MACHINE_ID=$1
+if [ "$MACHINE_ID" == "" ]; then
+ echo "usage: $0 NODE_NAME"
+ exit 255
+fi
+
+USER=$(grep "\<${MACHINE_ID}\>" ${FILE} | awk '{print $2}')
+if [ "$USER" == "" ]; then
+ echo "Error: Node ${MACHINE_ID} unknown"
+ exit 255
+fi
+
+HOST=$(grep "\<${MACHINE_ID}\>" ${FILE} | awk '{print $3}')
+if [ "$HOST" == "" ]; then
+ echo "Error: Node ${MACHINE_ID} unknown"
+ exit 255
+fi
+
+SSH_PORT=$(grep "\<${MACHINE_ID}\>" ${FILE} | awk '{print $4}')
+if [ "$SSH_PORT" == "" ]; 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}