From: Silvio Rhatto Date: Sat, 1 Jun 2013 20:57:24 +0000 (-0300) Subject: Shell wrapper X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=e0db44e7878715f054af351772ec2d309f8c8eb0;p=scripts.git Shell wrapper --- diff --git a/assh b/assh index 07e75f0..fb4c8b6 100755 --- a/assh +++ b/assh @@ -1,6 +1,6 @@ #!/bin/bash # -# simple autossh wrapper +# simple autossh and screen wrapper # BASENAME="`basename $0`" @@ -11,12 +11,17 @@ if [ -z "$DEST" ]; then exit 1 fi -if [ "$BASENAME" == "asshs" ]; then +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 diff --git a/shell b/shell new file mode 120000 index 0000000..daa19ce --- /dev/null +++ b/shell @@ -0,0 +1 @@ +assh \ No newline at end of file diff --git a/shelll b/shelll new file mode 120000 index 0000000..daa19ce --- /dev/null +++ b/shelll @@ -0,0 +1 @@ +assh \ No newline at end of file diff --git a/shells b/shells new file mode 120000 index 0000000..daa19ce --- /dev/null +++ b/shells @@ -0,0 +1 @@ +assh \ No newline at end of file