From b4e2708c6f8cc2191c581aef404803478e65e678 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 18 Sep 2014 16:47:55 -0300 Subject: Moved scripts to custom repos --- shell | 54 ------------------------------------------------------ 1 file changed, 54 deletions(-) delete mode 100755 shell (limited to 'shell') diff --git a/shell b/shell deleted file mode 100755 index e2a48c1..0000000 --- a/shell +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash -# -# Simple autossh and screen wrapper. -# - -# Parameters -BASENAME="`basename $0`" -DEST="$1" -COMMAND="$2" - -# Set screen title -# http://stackoverflow.com/questions/899609/gnu-screen-run-script-that-sends-commands-to-the-screen-session-it-is-being-run -function screen_title { - if [ -n "$STY" ]; then - screen -X title $1 - fi -} - -# Syntax check -if [ -z "$DEST" ]; then - exit 1 -fi - -# Set default screen title -screen_title $DEST - -# Dispatcher -if [ "$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 -else - if [ -z "$COMMAND" ] && screen -ls $DEST | grep -q "There is a screen on"; then - # Local existing screen shell - wscreen $DEST - elif [ -z "$COMMAND" ] && [ "$DEST" == "root" ]; then - # Local root shell - screen_title root - sudo screen -x - elif [ "$DEST" == "local" ]; then - # Local screen shell - screen_title $COMMAND - wscreen $COMMAND - else - # Remote shell using autossh - autossh $DEST -t -- $COMMAND - fi -fi - -# Restore screen title -screen_title terminal -- cgit v1.2.3