From 567e716c8696754f4b3323f962a616e9be12115d Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 4 May 2018 09:44:32 +0200 Subject: lib/common-functions: irc_say: accept channel as parameter --- lib/common-functions | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'lib/common-functions') diff --git a/lib/common-functions b/lib/common-functions index 038af38..86b8aaa 100755 --- a/lib/common-functions +++ b/lib/common-functions @@ -921,10 +921,18 @@ extract_pkgname_epoch_pkgver_pkgrel_sub_pkgrel_arch_from_package_name() { fi } -# irc_say -# say content of stdin in irc channel +# irc_say $channel +# say content of stdin in irc channel $channel (default: #archlinux32) + +# shellcheck disable=SC2120 irc_say() { - if [ -p "${irc_dir}/#archlinux32/in" ]; then - sponge "${irc_dir}/#archlinux32/in" + local channel + if [ -z "$1" ]; then + channel='#archlinux32' + else + channel="$1" + fi + if [ -p "${irc_dir}/${channel}/in" ]; then + sponge "${irc_dir}/${channel}/in" fi } -- cgit v1.2.3-70-g09d2