tdtach sessions manager - scripts - various script and utils
(HTM) git clone git://z3bra.org/scripts
(DIR) Log
(DIR) Files
(DIR) Refs
---
(DIR) commit dd74860608c08f879da4870f18f36e9d01f91670
(DIR) parent 59371792f34fc43b6ddb004ee23b1b7c780090c8
(HTM) Author: z3bra <willy@mailoo.org>
Date: Fri, 4 Apr 2014 16:14:13 +0200
dtach sessions manager
Diffstat:
A dm | 37 +++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/dm b/dm
t@@ -0,0 +1,37 @@
+#!/bin/sh
+#
+# z3bra - (c) wtfpl 2014
+# Create/list/attach/detach applications using dtach
+
+sockdir=~/var/run
+
+list() {
+ ls -1 $sockdir --color=auto
+}
+
+usage() {
+ echo "`basename $0` [-hl] <alias> [command]"
+}
+
+while getopts "l" opt; do
+ case $opt in
+ l) list; exit 0 ;;
+ h) usage; exit 0 ;;
+ *) usage; exit 1 ;;
+ esac
+done
+
+shift $((OPTIND - 1))
+
+case $# in
+ 0) usage; exit 1;;
+ 1) method=a;;
+ *) method=A;;
+esac
+name=$1
+
+shift
+
+socket="${sockdir}/${name}"
+
+dtach -${method} ${socket} -r winch $@