From aac9ed023d7ca852f9339e3a143b1b40b3045961 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sat, 1 Jun 2013 17:59:33 -0300 Subject: Changing symlink scheme of the shell wrapper --- shell | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) mode change 120000 => 100755 shell (limited to 'shell') diff --git a/shell b/shell deleted file mode 120000 index daa19ce..0000000 --- a/shell +++ /dev/null @@ -1 +0,0 @@ -assh \ No newline at end of file diff --git a/shell b/shell new file mode 100755 index 0000000..fb4c8b6 --- /dev/null +++ b/shell @@ -0,0 +1,27 @@ +#!/bin/bash +# +# simple autossh and screen wrapper +# + +BASENAME="`basename $0`" +DEST="$1" +COMMAND="$2" + +if [ -z "$DEST" ]; then + exit 1 +fi + +if [ "$BASENAME" == "asshs" ] || [ "$BASENAME" == "shells" ]; then + # Remote screen shell using autossh + if [ "$COMMAND" == "root" ]; then + autossh $DEST -t -- sudo screen -x + else + autossh $DEST -t -- screen -x $COMMAND + fi +elif [ "$BASENAME" == "shelll" ]; then + # Local screen shell + wscreen $* +else + # Remote shell using autossh + autossh $DEST -t -- $COMMAND +fi -- cgit v1.2.3