Introduction
Introduction Statistics Contact Development Disclaimer Help
annna-channel-service - annna - Annna the nice friendly bot.
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6…
Log
Files
Refs
Tags
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}" "${c…
23 exit $?
24 ;;
25 \#bitreich-radio)
26 radiobase="${modbase}/radio"
27 $radiobase/radio-channel-service.sh \
28 "${ircuser}" "${radiobase}" "${ircbase}" "${server}" "${…
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
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.