merge all per-channel loops - 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 b17b70bb499d4e446b86fdc682611d2047c71d57 DIR parent d11be415933db76b3339637fc93b11336137666a HTML Author: Josuah Demangeon <mail@josuah.net> Date: Mon, 8 Mar 2021 00:25:16 +0100 merge all per-channel loops Signed-off-by: Annna Robert-Houdin <annna@bitreich.org> Diffstat: M annna-start-services | 32 ++++++++----------------------- 1 file changed, 8 insertions(+), 24 deletions(-) --- DIR diff --git a/annna-start-services b/annna-start-services @@ -18,6 +18,7 @@ iibase="/home/annna/irc/${server}" modbase="/home/annna/bin/modules/" hashtagfile="${modbase}/hashtags/hashtags.txt" printnhashtags=2 +channel_list="#bitreich-en #bitreich-fr #bitreich-de #bitreich-nl #bitreich-it #bitreich-con #bitreich-scm #bitreich-cooking #bitreich-lawn #bitreich-tv #bitreich-meme #bitreich-radio" hashtags() { cat ${hashtagfile} 2>/dev/null @@ -805,32 +806,15 @@ annna_radio() { [ -d ${iiroot} ] && chmod o+rx ${iiroot} [ -d ${iibase} ] && chmod o+rx ${iibase} -# All channels -channel_list="#bitreich-en #bitreich-fr #bitreich-de #bitreich-nl #bitreich-it #bitreich-con #bitreich-scm #bitreich-cooking #bitreich-lawn #bitreich-tv #bitreich-meme #bitreich-radio" -for chan in $channel_list; -do - [ -d "${iibase}/${chan}" ] \ - && chmod o+rx "${iibase}/${chan}" - [ -p "${iibase}/${chan}/in" ] \ - && chmod o+w "${iibase}/${chan}/in" -done - -# Channels with extra features or external scripts. -## SCM (/scm/post-receive) -## This one is handled by channel_list. - -## Radio (/br/radio/playlist.sh + this script) -[ -d "${iibase}/#bitreich-radio" ] \ - && chmod o+rx "${iibase}/#bitreich-radio" -[ -p "${iibase}/#bitreich-radio/in" ] \ - && chmod o+w "${iibase}/#bitreich-radio/in" - - -# Channel handlers. - -## Common channel handler. +## Channel handlers for channel in $channel_list; do + # Permissions + [ -d "${iibase}/${channel}" ] \ + && chmod o+rx "${iibase}/${channel}" + [ -p "${iibase}/${channel}/in" ] \ + && chmod o+w "${iibase}/${channel}/in" + if [ -f "${iibase}/${channel}/out" ]; then {