hysteria

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

commit 6a99b1975776220c20848135b353e61a70aaf2e0
parent 3bb12c8fe6459ea05f8b87af3414c94c9ccd4d4b
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Fri,  9 May 2014 10:16:05 +0000

config: make ircdir configurable

Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>

Diffstat:
Mautojoin | 6++++--
Mconfig | 1+
Mconnectserver | 4++--
Mhysteria | 2+-
Mmonitor | 4+++-
5 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/autojoin b/autojoin @@ -1,5 +1,7 @@ #!/bin/sh +. ./config + if test $# -lt 2; then echo "usage: $(basename $0) host channel..." 1>&2 exit 1 @@ -15,6 +17,6 @@ fi host=$(echo $1 | awk -F: '{print $1}') shift for c in $*; do - echo "/join $c" > "irc/$host/in" - ./waitfile "irc/$host/$c/out" + echo "/join $c" > "$ircdir/$host/in" + ./waitfile "$ircdir/$host/$c/out" done diff --git a/config b/config @@ -2,3 +2,4 @@ nick="hysteria" fullname="hysteria" hosts="irc.network.org:6667 irc.network-other.org:6667" channels="irc.network.org:#channel irc.network-other.org:#channel" +ircdir="irc" diff --git a/connectserver b/connectserver @@ -16,6 +16,6 @@ fi host=$(echo $1 | awk -F: '{print $1}') port=$(echo $1 | awk -F: '{print $2}') -tmux new-window "ii -i irc -s $host -p $port -n $nick -f $fullname" +tmux new-window "ii -i $ircdir -s $host -p $port -n $nick -f $fullname" tmux rename-window "$host" -./waitfile "irc/$host/out" +./waitfile "$ircdir/$host/out" diff --git a/hysteria b/hysteria @@ -2,7 +2,7 @@ . ./config -rm -rf irc +rm -rf "$ircdir" tmux new-session -s hysteria -d ./monitor tmux rename-window "monitor" diff --git a/monitor b/monitor @@ -3,8 +3,10 @@ # Monitor for private messages and/or new channels and # create a new split tmux window +. ./config + while :; do - for n in $(find irc -type f -name "out" 2>/dev/null); do + for n in $(find $ircdir -type f -name "out" 2>/dev/null); do title=$(echo $n | awk -F/ '{ \ if (NF == 4) \ print $2":"$3; \