Add annna-cmd command. - annna - Annna the nice friendly bot.
(HTM) git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/annna/
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Tags
(DIR) README
---
(DIR) commit d01cfe61b4374d5b6a55347f4b9f6f7ffa165a07
(DIR) parent fe32740636247c579ee2a208ce9920dde7d73575
(HTM) Author: Annna Robert-Houdin <annna@bitreich.org>
Date: Tue, 26 Dec 2023 23:31:13 +0100
Add annna-cmd command.
Diffstat:
A annna-cmd | 2 ++
M annna-say | 11 +++++++++--
2 files changed, 11 insertions(+), 2 deletions(-)
---
(DIR) diff --git a/annna-cmd b/annna-cmd
@@ -0,0 +1 @@
+annna-say
+\ No newline at end of file
(DIR) diff --git a/annna-say b/annna-say
@@ -4,6 +4,13 @@
# annna-say -c 'irc.bitreich.org/#bitreich-en' Hello World!
#
+if [ "$(basename "$0")" = "annna-cmd" ];
+then
+ outfile="out"
+else
+ outfile="in"
+fi
+
export PATH="$PATH:/home/annna/bin"
usage() {
@@ -56,10 +63,10 @@ do
ircpath="${ircbase}/${cserver}/${cname}"
if [ -e "$ircpath/in" ];
then
- printf "%s\n" "$@" | fold -w 250 -s > "${ircpath}/in"
+ printf "%s\n" "$@" | fold -w 250 -s > "${ircpath}/${outfile}"
else
ircpath="${ircbase}/${cserver}"
- # Might be a user.
+ # Might be a user. Do not bother with outfile, he/she is not in our control.
printf "%s\n" "$@" \
| fold -w 250 -s \
| while read -r line;