Initial commit
This commit is contained in:
commit
d5048184a6
1 changed files with 31 additions and 0 deletions
31
macron-bot.sh
Executable file
31
macron-bot.sh
Executable file
|
@ -0,0 +1,31 @@
|
|||
#!/bin/sh
|
||||
|
||||
srv=irc.rezometz.org
|
||||
chan="#rezo"
|
||||
name="Macron"
|
||||
|
||||
monitor() {
|
||||
tail -f -n1 "$srv/$chan/out" | \
|
||||
while read -r date time nick msg
|
||||
do
|
||||
if echo "$msg" | grep -Eiq 'tocard'
|
||||
then
|
||||
echo "Est-ce que je peux dire autocar ?"
|
||||
elif echo "$msg" | grep -Eiq '^'"$name"'.*\?'
|
||||
then
|
||||
echo "PARCE QUE C'EST NOTRE PROJEEEET !"
|
||||
fi
|
||||
done > "$srv/$chan/in"
|
||||
}
|
||||
|
||||
while true; do
|
||||
ii -s "$srv" -n "$name" -f "Et Manuels Macront" -i . &
|
||||
iipid="$!"
|
||||
sleep 5
|
||||
printf "/j %s\n" "$chan" > "$srv/in"
|
||||
monitor&
|
||||
monitpid="$!"
|
||||
wait "$iipid"
|
||||
pkill -P "$monitpid"
|
||||
done
|
||||
|
Loading…
Reference in a new issue