buzz

tmux + nc talk
git clone git://git.2f30.org/buzz
Log | Files | Refs

buzz (377B)


      1 #!/bin/sh
      2 
      3 resolve()
      4 {
      5     for i in hosts/*; do
      6 	if [ `basename ${i}` = $1 ]; then
      7 	    cat hosts/$1
      8 	    return
      9 	fi
     10     done
     11     echo $1
     12 }
     13 
     14 new_session()
     15 {
     16     host=`resolve $1`
     17     tmux new-session -s "`basename $1`" -d "./client ${host}" \; split-window -d "./server" \; attach
     18 }
     19 
     20 if [ ! $# -eq 1 ]; then
     21     echo "usage: buzz <hostname>" 1>&2
     22     exit 1
     23 fi
     24 
     25 new_session $1