[Linux-bruxelles] IRC
Aldo
info at brlspeak.net
Lun 31 Jan 06:31:39 CET 2022
Bonjour.
J'essaye de participer au salon chat #resonance-irc sur irc.libera.chat,
j'ai donc resorti un petit script Bash fait il y a (très) longtemps; mais
ça ne tourne pas rond, et bizarrement ça me remet au début de la boucle /
du menu, alors que je ne vois aucun msg d'erreur.
(J'ai essayé avec ou sans le "#" devant resonance-irc, sans effet).
Le voici; qq'un aurait-il + d'inspiration que bibi :
#####
#!/bin/bash
# .....
# Just put this in your /usr/local/bin dir and run the "bxm" script when
# connected to the Internet.
# Personalize bxm by creating a ~/.ircrc file with preferences.
# If the rc file does not exist, it will be created now...
RC=".ircrc"
rm ~/$RC
# The next 2 lines are set by default; you may recomment them if they
# doesn't match with your personal preferences...:
echo "sleep 7">~/$RC
echo "/toggle log">>~/$RC
# Note: ~/.ircrc is deleted/created after each session.
BX="ircii"
#BX="irc"
# (or irssi / bitchx ...)
NA="hohooh"
NB="eeeteee"
NC="blablaaah"
#ND=""
#NE=""
SA="irc.libera.chat"
SB="irc.kewl.org"
SC="another.irc.channel"
#
function F1 ()
{
echo "BXM - BitchX/IRC/IRCII/IRSSI Menu"
echo
echo Using ~/$RC with settings:
cat ~/$RC
echo
echo "Select your nickname: "
cat << EOF
[1]: $NA
[2]: $NB
[3]: $NC
[0]: Quit
EOF
echo
echo -ne "\a"
read -p "Select nickname (ctrl+c / 0=quit): " NN
case "$NN" in
1) Nick=$NA ;;
2) Nick=$NB ;;
3) Nick=$NC ;;
*) clear && echo "Goodbye!" && exit 1 ;;
esac
#clear
#echo "BXM - BitchX/IRC/IRCII/IRSSI Menu"
echo
echo "Select a chat server: "
cat << EOF
[1]: $SA
[2]: $SB
[3]: $SC
[0]: Quit
EOF
echo
echo -ne "\a"
read -p "Select chat server (ctrl+c / 0=quit): " CS
case "$CS" in
1) Srv=$SA ;;
2) Srv=$SB ;;
3) Srv=$SC ;;
*) clear && echo "Goodbye!" && exit 1 ;;
esac
#clear
echo
read -p "Specify a port if necessary: " PX
echo
read -p "Specify the chatroom if necessary: " RX
setleds -num
clear
if test -z "$RX"
then
if test -z "$PX"
then
$BX $Nick $Srv
exec $0
else
$BX $Nick $Srv:$PX
exec $0
fi
else
if test -z "$PX"
then
rm ~/IrcLog
$BX $Nick $Srv -c \#$RX -l ~/$RC
exec $0
else
rm ~/IrcLog
$BX $Nick $Srv:$PX -c \#$RX -l ~/$RC
exec $0
fi
fi
}
function F2 ()
{
rm ~/.IrcLog.bak
mv ~/.IrcLog ~/.IrcLog.bak
head -3 ~/IrcLog >~/IrcLog.tmp
#head -1 ~/IrcLog >~/IrcLog.tmp
grep "<*>" ~/IrcLog >>~/IrcLog.tmp
tail -1 ~/IrcLog >>~/IrcLog.tmp
mv ~/IrcLog ~/.IrcLog
mv ~/IrcLog.tmp ~/IrcLog
#less ~/IrcLog
#links ~/IrcLog
lynx ~/IrcLog
#more ~/IrcLog
exec $0
}
clear
setleds +num
echo Running BXM...
read -p"1)Chat or 2)review previous conversation (/leave blank to exit): " CHX
clear
test -z "$CHX" && clear && echo Nothing to do... Quiting! && exit
F$CHX
# end of script
#####
A+
Aldo.
Plus d'informations sur la liste de diffusion Linux-bruxelles