hysteria

ii wrapper script
git clone git://git.2f30.org/hysteria
Log | Files | Refs | README | LICENSE

hysteria-autojoin (439B)


      1 #!/bin/sh
      2 
      3 if test $# -lt 2; then
      4 	echo "usage: $(basename $0) host channel [config]" 1>&2
      5 	exit 1
      6 fi
      7 
      8 if [ "$3" = "" ]; then
      9 	. "$HOME/.hysteria/config"
     10 else
     11 	. "$3"
     12 fi
     13 
     14 tmux list-sessions -F '#S' 2>/dev/null | \
     15 	grep "^$session$" >/dev/null 2>/dev/null
     16 if [ $? -eq 1 ]; then
     17 	echo "no hysteria session \"$session\" running" 1>&2
     18 	exit 1
     19 fi
     20 
     21 host="$1"
     22 c="$2"
     23 echo "/join $c" > "$ircdir/$host/in"
     24 hysteria-waitfile "$ircdir/$host/$c/out"