Import some files from pbot-ng project and branding this project to hyperbot
This commit is contained in:
43
issues_change_detector
Executable file
43
issues_change_detector
Executable file
@@ -0,0 +1,43 @@
|
||||
#! /bin/bash
|
||||
|
||||
if ! which inotifywait &> /dev/null
|
||||
then
|
||||
echo 'inotify is a dep. fail'
|
||||
exit
|
||||
fi
|
||||
|
||||
bot_ipc="/tmp/un-provoked-message-store"
|
||||
maildir="/srv/hyperbot/Maildir/new"
|
||||
|
||||
shopt -s extglob
|
||||
|
||||
next_line_is_url=0
|
||||
|
||||
inotifywait -m --format '%w%f' -e create "${maildir}" 2>/dev/null |
|
||||
while read email
|
||||
do
|
||||
while read line
|
||||
do
|
||||
case "${line}" in
|
||||
'Subject: ['* )
|
||||
lp1="${line#Subject: [}"
|
||||
lp="${lp1%% - *}"
|
||||
echo -n "${lp}"
|
||||
;;
|
||||
'Issue #'* )
|
||||
echo -n " - ${line}"
|
||||
;;
|
||||
*' #'+([[:digit:]])': '* )
|
||||
echo -n " (${line#'Bug #'+([[:digit:]])': '})"
|
||||
next_line_is_url=1
|
||||
;;
|
||||
'https://issues.hyperbola.info/issues/'* )
|
||||
(( next_line_is_url )) &&
|
||||
echo -n " ${line}"
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done < "${email}"
|
||||
|
||||
echo
|
||||
done >> "${bot_ipc}"
|
||||
Reference in New Issue
Block a user