selftest: Add support for tmate.
authorAndreas Schneider <asn@samba.org>
Thu, 5 Jun 2014 13:07:07 +0000 (15:07 +0200)
committerMichael Adam <obnox@samba.org>
Fri, 6 Jun 2014 00:25:52 +0000 (02:25 +0200)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Jun  6 02:25:52 CEST 2014 on sn-devel-104

selftest/in_screen

index 5468a216e310fb7c2c2cc27804f97252fac37486..36c3da119189a16213571a4a2a2b6f11c958090f 100755 (executable)
@@ -69,8 +69,14 @@ cleanup() {
 rm -f $basedir/$SERVERNAME.status $basedir/$SERVERNAME.log
 echo $$ > $basedir/$SERVERNAME.parent.pid
 trap cleanup SIGINT SIGTERM SIGPIPE
+
 if [[ "$TMUX" ]]; then
-    tmux new-window -n test:$SERVERNAME "bash $basedir/$SERVERNAME.launch"
+    TMUX_CMD=tmux
+    if [[ $TMUX = *tmate* ]]; then
+        TMUX_CMD=tmate
+    fi
+
+    $TMUX_CMD new-window -n test:$SERVERNAME "bash $basedir/$SERVERNAME.launch"
 else
     screen -r -X screen -t test:$SERVERNAME bash $basedir/$SERVERNAME.launch
 fi