dotfiles

Settings and scripts
git clone git://git.konyahin.xyz/dotfiles
Log | Files | Refs | LICENSE

irc-client (644B)


      1 #!/usr/bin/env sh
      2 
      3 set -e
      4 
      5 if [ -z "$1" ]; then
      6     echo "Specify network or channel"
      7     exit 1
      8 fi
      9 
     10 libera () {
     11     SERVER=irc.libera.chat
     12     PORT=6665
     13 }
     14 
     15 oftc () {
     16     SERVER=irc.oftc.net
     17     PORT=6667
     18 }
     19 
     20 case $1 in "libera")
     21     libera;;
     22 "oftc")
     23     oftc;;
     24 "suckless")
     25     oftc
     26     CHANNEL="#suckless";;
     27 "openbsd")
     28     libera
     29     CHANNEL="#openbsd";;
     30 *)
     31     echo "Unknown network or channel: $1"
     32     exit 1;;
     33 esac
     34 
     35 PASS=$(pass irc/password)
     36 NICK=kon4ru
     37 
     38 COMMAND="-s $SERVER -p $PORT -n $NICK"
     39 if [ ! -z "$CHANNEL" ]; then
     40     COMMAND="$COMMAND -c $CHANNEL"
     41 fi
     42 COMMAND="$COMMAND -x"
     43 
     44 kirc $COMMAND <<END
     45 privmsg NickServ :identify $PASS
     46 END