URI: 
       annna-channel-service - 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
       ---
       annna-channel-service (1040B)
       ---
            1 #!/bin/sh
            2 #
            3 # Per-channel daemon that monitors incoming messages from ii out script.
            4 #
            5 
            6 pgrep -f "$0 $*" | grep -vxq "$$" && exec echo "$0 $* already running"
            7 #trap 'exec pkill -U annna -f "entr .* ${PWD}/out"' INT TERM EXIT HUP
            8 
            9 server="$1"
           10 channel="$2"
           11 
           12 cfgbase="$(pwd)"
           13 ircbase="$(cat ${cfgbase}/ircbase)"
           14 ircuser="$(cat ${cfgbase}/${server}/ircuser)"
           15 serverbase="${ircbase}/${server}"
           16 modbase="$(cat ${cfgbase}/modbase)"
           17 
           18 case "${channel}" in
           19 \#bitreich-idle)
           20         idlebase="${modbase}/idlerpg"
           21         $idlebase/idlerpg-channel-service.py \
           22                 "${ircuser}" "${idlebase}" "${ircbase}" "${server}" "${channel}" &
           23         exit $?
           24         ;;
           25 \#bitreich-radio)
           26         radiobase="${modbase}/radio"
           27         $radiobase/radio-channel-service.sh \
           28                 "${ircuser}" "${radiobase}" "${ircbase}" "${server}" "${channel}" &
           29 esac
           30 
           31 ls "${serverbase}/${channel}/out" \
           32         | entr tail -n 1 "${serverbase}/${channel}/out" 2>/dev/null \
           33         | sed -nu 's,[0-9]* <\([^ >]*\)> \(.*\),\1 \2,p' \
           34         | {
           35 while read -r user text;
           36 do
           37         annna-channel-message "${server}" "${channel}" "${user}" "${text}"
           38 done
           39 }
           40