#!/bin/sh # identify to nickserv and log in to the correct irc channels # shellcheck disable=SC2119,SC2120 # shellcheck source=../lib/load-configuration . "${0%/*}/../lib/load-configuration" # wait for nickserv complaint while ! grep -qF 'This nickname is registered. Please choose a different nickname' "${irc_dir}/nickserv/out"; do sleep 1 done # wait for registering to succeed while ! grep -q 'You are \(now identified for\|already logged in as\) ' "${irc_dir}/nickserv/out"; do # register printf 'identify %s\n' "${irc_password}" | \ sponge "${irc_dir}/nickserv/in" sleep 5 done # join channel echo '/j #archlinux32' | \ sponge "${irc_dir}/in"