summaryrefslogtreecommitdiff
path: root/bin/ii-connect
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-01-22 20:33:40 +0100
committerErich Eckner <git@eckner.net>2018-01-22 20:33:40 +0100
commit7d67a5bf7d76d8a5b2b11b77a3c17eb37b66be96 (patch)
tree0dfbcbca9c102095517925c6ffb79c80a9da2850 /bin/ii-connect
parent170263108c8a6bf53fbfb22f8c7275bfff784edf (diff)
downloadbuilder-7d67a5bf7d76d8a5b2b11b77a3c17eb37b66be96.tar.xz
use sponge to send irc messages w/o being interrupted
Diffstat (limited to 'bin/ii-connect')
-rwxr-xr-xbin/ii-connect12
1 files changed, 6 insertions, 6 deletions
diff --git a/bin/ii-connect b/bin/ii-connect
index b703d77..54e1eb0 100755
--- a/bin/ii-connect
+++ b/bin/ii-connect
@@ -15,8 +15,8 @@ fi
# register if not yet done
if tail -n1 "${irc_dir}/nickserv/out" 2> /dev/null | \
grep -qF 'This nickname is registered. Please choose a different nickname'; then
- printf 'identify %s\n' "${irc_password}" > \
- "${irc_dir}/nickserv/in"
+ printf 'identify %s\n' "${irc_password}" | \
+ sponge "${irc_dir}/nickserv/in"
fi
# join #archlinux-ports if not yet done
@@ -26,8 +26,8 @@ if ! grep ' buildmaster\.archlinux32\.org .* buildmaster$' "${irc_dir}/out" | \
{
echo '/j #archlinux-ports'
echo '/WHO buildmaster'
- } > \
- "${irc_dir}/in"
+ } | \
+ sponge "${irc_dir}/in"
fi
# start watch daemon if not running yet
@@ -69,8 +69,8 @@ if [ "$1" = 'watch' ]; then
echo "${reason}" | \
head -n5
printf '... (%s lines total)\n' "$(echo "${reason}" | wc -l)"
- fi > \
- "${out_file%/out}/in"
+ fi | \
+ sponge "${out_file%/out}/in"
done
sed -i "/${regex}/d" "${out_file}"
fi