Permalink
Browse files

More workingness

  • Loading branch information...
1 parent 4d52d1e commit f89d039726854d3cf3e169463c6b1fb860329147 @rking rking committed with rking@sharpsaw.org Jan 7, 2013
Showing with 8 additions and 3 deletions.
  1. +8 −3 bin/tweemux
View
@@ -1,5 +1,10 @@
#!/bin/sh -xe
s=/tmp/tweemux
-tmux -S $s start-server
-chmod 777 $s
-tmux -S $s "$@"
+if [ ! -e $s ]; then # I'm the leader
+ tmux -S $s start-server
+ chmod 777 $s
+ tmux -S $s "$@"
+ rm $s
+else # I'm the follower
+ tmux -S $s attach
+fi

0 comments on commit f89d039

Please sign in to comment.