aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-06-01 17:57:24 -0300
committerSilvio Rhatto <rhatto@riseup.net>2013-06-01 17:57:24 -0300
commite0db44e7878715f054af351772ec2d309f8c8eb0 (patch)
tree2e0c74f23901499fc43f1248298e3c88cdb96467
parent414b5566eea57f535b09c8cce339cf6e714f3f0b (diff)
downloadscripts-e0db44e7878715f054af351772ec2d309f8c8eb0.tar.gz
scripts-e0db44e7878715f054af351772ec2d309f8c8eb0.tar.bz2
Shell wrapper
-rwxr-xr-xassh9
l---------shell1
l---------shelll1
l---------shells1
4 files changed, 10 insertions, 2 deletions
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