A few cleanups. - annna - Annna the nice friendly bot. HTML git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/annna/ DIR Log DIR Files DIR Refs DIR Tags DIR README --- DIR commit 3f347661ec75dffbff4ec2f3c8759b0d81794c9b DIR parent 555e3461df780101ecd298afc9f2e1b0b8c29ae0 HTML Author: eidolon <me@svickova.ma> Date: Tue, 28 Feb 2023 00:03:43 -0500 A few cleanups. Signed-off-by: Annna Robert-Houdin <annna@bitreich.org> Diffstat: M annna-message-common | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) --- DIR diff --git a/annna-message-common b/annna-message-common @@ -106,11 +106,7 @@ case "${text}" in ;; *imgur.com/*) - nuris="$(youtube-dl -g "${uri}")" - if [ $? -gt 0 ]; - then - nuris="" - fi + nuris="$(youtube-dl -g "${uri}")" || nuris="" ;; *xkcd.com/*) nuris="$(xkcd-uri "${uri}")" @@ -224,7 +220,7 @@ esac case "${text}" in "${ircuser}"?) - exclamation="$(printf "${text}\n" | sed "s,${ircuser}\(.\),\1,g")" + exclamation="$(printf "%s\n" "${text}" | sed "s,${ircuser}\(.\),\1,g")" exclamationsintime=$(exclamatio "${user}") finalexclamation="${exclamation}" while [ $exclamationsintime -gt 1 ]; @@ -307,8 +303,7 @@ case "${text}" in "${ircuser}, cowsay "*) word="$(printf "%s\n" "${text}" | cut -c 15-)" tmpf=$(mktemp) - cowsayasaservice ${word} > ${tmpf} - if [ $? -eq 0 ]; then + if cowsayasaservice ${word} > ${tmpf}; then curi="$(/br/bin/bitreich-paste < ${tmpf})" annna-say -s "${server}" -c "${channel}" "${user}: the cow said... ${curi}" fi @@ -1172,7 +1167,7 @@ $0 !~ /#nospoil/ { } }' | while read -r tag; do - [ "${tag}" == "#expand" ] && continue + [ "${tag}" = "#expand" ] && continue origtag="${tag}" pointer=0