#!/bin/bash while getopts "hwa" optname do case "$optname" in "h") HOST=1 ;; "w") WALL=1 ;; "a") ALL=1 ;; "?") echo "Unrecognized option $OPTARG" exit ;; ":") echo "No argument value for option $OPTARG" exit ;; esac done if [ "$WALL" != "1" -a "$HOST" != "1" -a "$ALL" != "1" ]; then echo "Usage: connect_to_wall [-h] [-w] [-a]. One option must be specified." echo -e "\t-h\trun on host" echo -e "\t-w\trun on wall" echo -e "\t-a\trun on host and wall" exit fi if [ "$WALL" == "1" -o "$ALL" == "1" ]; then gnome-terminal -t "Left Tile [192.168.41.10]" --geometry 117x24+0+0 -x ssh -t SAGE-tile0 "cd /etc/X11; bash" & gnome-terminal -t "Right Tile [192.168.41.11]" --geometry 117x24+960+0 -x ssh -t SAGE-tile1 "cd /etc/X11; bash" & fi if [ "$HOST" == "1" -o "$ALL" == "1" ]; then gnome-terminal -t "Access machine [192.168.41.1]" --geometry 235x38+0+459 --working-directory /usr/local/sage/sageConfig & fi