From 317a62223535ecec121c19f7b10c590ee3b2e7a7 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 23 Apr 2018 08:55:58 +0200 Subject: bin/ii-connect: "whatsup" new --- bin/ii-connect | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'bin/ii-connect') diff --git a/bin/ii-connect b/bin/ii-connect index ca8ea99..d678af1 100755 --- a/bin/ii-connect +++ b/bin/ii-connect @@ -79,8 +79,10 @@ if [ "$1" = 'watch' ]; then channel="${channel##*/}" if [ -z "${channel%%#*}" ]; then prefix='buildmaster: ' + sloppy_salutation='buildmaster' else prefix='' + sloppy_salutation='' fi regex='^\(\S\+ \)\?\S\+ <\S\+> '"${prefix}"'why[- ]don'"'"'\?t[- ]you \(build\|stabilize\|unstage\|keep\|stubbornly_keep\) ' if grep -q "${regex}" "${out_file}"; then @@ -130,6 +132,14 @@ if [ "$1" = 'watch' ]; then done sed -i "/${regex}/d" "${out_file}" fi + regex='^\(\S\+ \)\?\S\+ <\S\+> .*[Ww]hat'"'"'\?s *[Uu]p' + if grep "${regex}" "${out_file}" | \ + grep -q "${sloppy_salutation}"; then + done_something=true + sed -i "/${regex}/d" "${out_file}" + printf 'up? I'"'"'m up for %s, %s\n' "$(uptime -p | sed 's/^up //')" "$(uptime | sed 's/.*, //')" | \ + sponge "${out_file%/out}/in" + fi done sleep 1 done -- cgit v1.2.3-54-g00ecf From ac07214218710b41db233b387b4bcb816b489e86 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 1 May 2018 23:12:03 +0200 Subject: bin/ii-connect: some more manners --- bin/ii-connect | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'bin/ii-connect') diff --git a/bin/ii-connect b/bin/ii-connect index d678af1..07f47c6 100755 --- a/bin/ii-connect +++ b/bin/ii-connect @@ -140,6 +140,14 @@ if [ "$1" = 'watch' ]; then printf 'up? I'"'"'m up for %s, %s\n' "$(uptime -p | sed 's/^up //')" "$(uptime | sed 's/.*, //')" | \ sponge "${out_file%/out}/in" fi + regex='^\(\S\+ \)\?\S\+ <\S\+> \(.* \)\?[Tt]h\(anks\|x\)\([ ,.]\|$\)' + if grep "${regex}" "${out_file}" | \ + grep -q "${sloppy_salutation}"; then + done_something=true + sed -i "/${regex}/d" "${out_file}" + printf 'np\n' | \ + sponge "${out_file%/out}/in" + fi done sleep 1 done -- cgit v1.2.3-54-g00ecf From b8763816fbc71d088aa0ff6945507d19f8833dcd Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 1 May 2018 23:13:54 +0200 Subject: bin/ii-connect: accept !, too --- bin/ii-connect | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin/ii-connect') diff --git a/bin/ii-connect b/bin/ii-connect index 07f47c6..5fc5f37 100755 --- a/bin/ii-connect +++ b/bin/ii-connect @@ -140,7 +140,7 @@ if [ "$1" = 'watch' ]; then printf 'up? I'"'"'m up for %s, %s\n' "$(uptime -p | sed 's/^up //')" "$(uptime | sed 's/.*, //')" | \ sponge "${out_file%/out}/in" fi - regex='^\(\S\+ \)\?\S\+ <\S\+> \(.* \)\?[Tt]h\(anks\|x\)\([ ,.]\|$\)' + regex='^\(\S\+ \)\?\S\+ <\S\+> \(.* \)\?[Tt]h\(anks\|x\)\([ ,.!]\|$\)' if grep "${regex}" "${out_file}" | \ grep -q "${sloppy_salutation}"; then done_something=true -- cgit v1.2.3-54-g00ecf