aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMárcio Silva <coadde at hyperbola dot info>2017-06-03 07:35:15 -0300
committerMárcio Silva <coadde at hyperbola dot info>2017-06-03 07:35:15 -0300
commit7eb1df0ef4ccc5bc3e9c5a74dea6a5b796cc3cb4 (patch)
tree04af6018248ea197b368043ee9fea6c48c28e224
parentae928016bf637b26326ec335b10898c6c2b0e4b9 (diff)
downloadhyperbot-7eb1df0ef4ccc5bc3e9c5a74dea6a5b796cc3cb4.tar.lz
hyperbot-7eb1df0ef4ccc5bc3e9c5a74dea6a5b796cc3cb4.tar.xz
hyperbot-7eb1df0ef4ccc5bc3e9c5a74dea6a5b796cc3cb4.zip
update issues_change_detector from pbot-ng, change unknown ip6 2001:ba8:1f1:f216::5 to ::1, ignore bot_settings.sh, fix description on hack_of_all_hacks
-rw-r--r--.gitignore1
-rw-r--r--hack_of_all_hacks2
-rwxr-xr-xissues_change_detector54
-rw-r--r--transport/dev-tcp.sh2
-rw-r--r--transport/socat.sh2
5 files changed, 33 insertions, 28 deletions
diff --git a/.gitignore b/.gitignore
index 440fcc7..a9e44af 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
announcements/people/*
+bot_settings.sh
logs
diff --git a/hack_of_all_hacks b/hack_of_all_hacks
index 154d922..af34377 100644
--- a/hack_of_all_hacks
+++ b/hack_of_all_hacks
@@ -289,7 +289,7 @@ function l33t_codes
"${my_own_name}: tell "+([![:space:]])":"+([[:space:]])+([![:space:]])* )
# The line will be something such as:
- # hyperbot: tell user: you suck
+ # hyperbot: tell user: hi
process="${sentence##${my_own_name}: tell }"
subject="${process%%:*}"
message="${process#*:}"
diff --git a/issues_change_detector b/issues_change_detector
index 50479d9..04a6c9b 100755
--- a/issues_change_detector
+++ b/issues_change_detector
@@ -14,30 +14,34 @@ 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
+ while read email
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}"
+ 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://labs.parabola.nu/issues/'* )
+ (( next_line_is_url )) &&
+ echo -n " ${line}"
+ break
+ ;;
+ esac
+ done < "${email}"
- echo
-done >> "${bot_ipc}"
+ echo
+ done |
+ while read message
+ do
+ echo "${message}" >> "${bot_ipc}"
+ done
diff --git a/transport/dev-tcp.sh b/transport/dev-tcp.sh
index 49712b2..36c0c8c 100644
--- a/transport/dev-tcp.sh
+++ b/transport/dev-tcp.sh
@@ -88,7 +88,7 @@ transport_read_line() {
[[ -w /tmp/un-provoked-message-store ]] && (( ${ze_length%% *} ))
then
read -r line < /tmp/un-provoked-message-store
- line=':tlCJ99mfZl!~user@2001:ba8:1f1:f216::5 PRIVMSG #hyperbola :'"${line}"
+ line=':tlCJ99mfZl!~user@::1 PRIVMSG #hyperbola :'"${line}"
# remove the top line of the file
if (( ${ze_length%% *} < 2 ))
diff --git a/transport/socat.sh b/transport/socat.sh
index d755108..dcf92b0 100644
--- a/transport/socat.sh
+++ b/transport/socat.sh
@@ -173,7 +173,7 @@ transport_read_line() {
[[ -w /tmp/un-provoked-message-store ]] && (( ${ze_length%% *} ))
then
read -r line < /tmp/un-provoked-message-store
- line=':tlCJ99mfZl!~user@2001:ba8:1f1:f216::5 PRIVMSG #hyperbola :'"${line}"
+ line=':tlCJ99mfZl!~user@::1 PRIVMSG #hyperbola :'"${line}"
if (( ${ze_length%% *} < 2 ))
then