Introduction
Introduction Statistics Contact Development Disclaimer Help
Preparing multi-server support. - annna - Annna the nice friendly bot.
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6…
Log
Files
Refs
Tags
README
---
commit f2073d06cdc3f2b9f39c74384e9d93e90c5cb968
parent c128f94676902d9f277acd269fd01db21c3c8470
Author: Annna Robert-Houdin <[email protected]>
Date: Fri, 31 Dec 2021 12:31:12 +0100
Preparing multi-server support.
* check if credentials are present, so invoke ii differently.
Diffstat:
M annna-channel-service | 7 +++++--
M annna-message-common | 7 ++++---
M annna-message-radio | 7 ++++---
M annna-say | 13 ++++++++++---
M annna-start-main | 17 ++++++++++++-----
5 files changed, 35 insertions(+), 16 deletions(-)
---
diff --git a/annna-channel-service b/annna-channel-service
@@ -21,10 +21,13 @@ while read -r user text;
do
case "${channel}" in
\#bitreich-radio)
- annna-message-radio "${channel}" "${user}" "${text}"
+ annna-message-radio "${server}" "${channel}" "${user}" "${text…
+ ;;
+ \#gopherproject)
+ annna-message-gopherproject "${server}" "${channel}" "${user}"…
;;
*)
- annna-message-common "${channel}" "${user}" "${text}"
+ annna-message-common "${server}" "${channel}" "${user}" "${tex…
;;
esac
done
diff --git a/annna-message-common b/annna-message-common
@@ -14,9 +14,10 @@ printnhashtags=2
botname="annna"
brmembers="__20h__ Evil_Bob chripo posativ quinq stateless solene josuah paraz…
-channel="$1"
-user="$2"
-text="$3"
+server="$1"
+channel="$2"
+user="$3"
+text="$4"
annnasumerian="𒈹"
hashtags() {
diff --git a/annna-message-radio b/annna-message-radio
@@ -3,9 +3,10 @@
modbase="/home/annna/bin/modules/"
botname="annna"
-channel="$1"
-user="$2"
-text="$3"
+server="$1"
+channel="$2"
+user="$3"
+text="$4"
[ "$user" = "${botname}" ] && exit
diff --git a/annna-say b/annna-say
@@ -6,23 +6,30 @@
export PATH="$PATH:/home/annna/bin"
usage() {
- printf "usage: %s [-h] [-i ircbase] -c \"channel0 ... channel1 ...\" t…
+ printf "usage: %s [-h] [-i ircbase] [-s server] -c \"channel0 ... chan…
"$(basename "$1")" >&2
exit 1
}
channels=""
-ircbase="/home/annna/irc/irc.bitreich.org"
+server="irc.bitreich.org"
+ircbase="/home/annna/irc/${server}"
+ircbaseset=0
-while getopts "hb:c:" opt;
+while getopts "hb:c:s:" opt;
do
case $opt in
b)
ircbase="$OPTARG"
+ ircbaseset=1
;;
c)
channels="$OPTARG"
;;
+ s)
+ server="$OPTARG"
+ [ $ircbaseset -eq 0 ] && ircbase="/home/annna/irc/${server}"
+ ;;
*)
usage $0
;;
diff --git a/annna-start-main b/annna-start-main
@@ -32,13 +32,20 @@ rm -f "$HOME/irc/${server}/sock"
#done
# Connection
-export ircuser="$(sed -n 's/^user: //p' $HOME/annna/${server}/irc-credentials.…
-export ircpass="$(sed -n 's/^pass: //p' $HOME/annna/${server}/irc-credentials.…
+export ircuser="$(sed -n 's/^user: //p' $HOME/annna/${server}/irc-credentials.…
+export ircpass="$(sed -n 's/^pass: //p' $HOME/annna/${server}/irc-credentials.…
#ii -s "${server}" -t -p 6697 -n "$ircuser" -k ircpass \
# -f "Annna Robert-Houdin" &
-ii -s "${server}" -v -t -p 6697 -n "$ircuser" \
- -f "Annna Robert-Houdin" &
-iipid=$!
+if [ -n "${ircuser}" -a -n "${ircpass}" ];
+then
+ ii -s "${server}" -v -t -p 6697 -n "$ircuser" \
+ -f "Annna Robert-Houdin" &
+ iipid=$!
+else
+ ii -s "${server}" -v -t -p 6697 \
+ -f "Annna Robert-Houdin" &
+ iipid=$!
+fi
{
# Watch for ii to exit. Then remove the used directory to have all
You are viewing proxied material from bitreich.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.