use ii(1) SASL authentication mechanism - annna - Annna the nice friendly bot. HTML git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/annna/ DIR Log DIR Files DIR Refs DIR Tags DIR README --- DIR commit 39f8fef14370ba20fa10d72e8508ffe7694f228f DIR parent 14414f5c73b26e6bca160d27954e5b132abf0a81 HTML Author: Josuah Demangeon <mail@josuah.net> Date: Sun, 7 Mar 2021 23:56:48 +0100 use ii(1) SASL authentication mechanism ii(1) supports -k PASSENV variable, so does chat.freenode.net (default server). annna now make use of these. Signed-off-by: Annna Robert-Houdin <annna@bitreich.org> Diffstat: M annna-start-main | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) --- DIR diff --git a/annna-start-main b/annna-start-main @@ -30,7 +30,9 @@ do done # Connection -ii -s "$server" -u $HOME/${server}/sock -n annna \ +export ircuser="$(sed -n 's/^user //p' $HOME/irc/${server}/irc-credentials.txt)" +export ircpass="$(sed -n 's/^pass //p' $HOME/irc/${server}/irc-credentials.txt)" +ii -s "${server}" -u $HOME/${server}/sock -n "$ircuser" -k ircpass \ -f "Annna Robert-Houdin" & ## Waiting for the socket to be available. @@ -52,26 +54,6 @@ done sleep 2 -# Nickserv -ircuser="$(grep user $HOME/irc/${server}/irc-credentials.txt | cut -d' ' -f 2)" -ircpass="$(grep pass $HOME/irc/${server}/irc-credentials.txt | cut -d' ' -f 2)" -printf "/privmsg nickserv :identify %s %s\n" "${ircuser}" "${ircpass}" \ - > ${server}/in - -## Check that nickserv is there. -while [ ! -e $HOME/irc/${server}/nickserv/out ]; -do - sleep 0.5 -done - -## Waiting for us to be authenticated. -while [ -z "$(grep "You are now identified for" \ - $HOME/irc/${server}/nickserv/out)" ]; -do - sleep 0.5 -done - - # Channels for chan in ${channels}; do