#!/bin/bash # esempio di automatizzazione di connessione ad un server lanciato via pbs su nodo remoto # Qui e' tutto cablato nel codice: # - nodo ponte (login2.plx.cineca.it) # - posizione vncviewer in locale (~/Scrivania/remoteGraph/TurboVNC/install/bin/vncviewer) # - utente con cui si esegue il tunnel (non specificato quindi = a username con cui si esegue lo script) user=cin0641a tvnc_path=/opt/TurboVNC/bin echo " I am ${user} and TurboVNC is located in ${tvnc_path} " connection=`ssh ${user}@login2.plx.cineca.it /plx/userinternal/${user}/crv/crv_connect --from-client "$@"` ; res=$? echo "$connection" if [[ $res -ne 0 ]] ; then echo "Can't get connection, abort." exit 1 fi node=$(echo "$connection" | grep "^node:" | cut -f2 -d: ) display=$(echo "$connection" | grep "^vnc:" | cut -f2 -d: ) ${tvnc_path}/vncviewer -via ${user}@login2.plx.cineca.it $node:$display