irc-bot/connect-handler

24 lines
426 B
Bash
Executable File

#! /bin/sh -e
# UCSPI wants communication on fd7
if [ -n "$PROTO" ]; then
fd=7
else
fd=1
fi
if [ -x $botdir/login ]; then
$botdir/login 1>& $fd
else
echo "NICK $nickname" 1>& $fd
echo "USER $nickname $nickname $nickname :$realname" 1>& $fd
fi
if [ -f $botdir/opts ]; then
read -r opts < $botdir/opts
else
opts="-i 500000"
fi
exec $ircdir/dispatch $fifo $opts $ircdir/irc-filter $botdir/handler