summaryrefslogtreecommitdiffstats
path: root/ircbot.bash
diff options
context:
space:
mode:
Diffstat (limited to 'ircbot.bash')
-rwxr-xr-xircbot.bash6
1 files changed, 3 insertions, 3 deletions
diff --git a/ircbot.bash b/ircbot.bash
index c50518b..3939311 100755
--- a/ircbot.bash
+++ b/ircbot.bash
@@ -73,7 +73,7 @@ verbose() {
}
connect() {
- if ! exec 3<>"/dev/tcp/$IRCBOT_HOST/$IRCBOT_PORT"; then
+ if ! exec {_ircbot_fd}<>"/dev/tcp/$IRCBOT_HOST/$IRCBOT_PORT"; then
return $?
fi
@@ -197,13 +197,13 @@ sendmsg() { # args: $1 - command, $2... - args (any number)
if ! _trigger sendmsg "$msg" "$cmd" "${args[@]}"; then
return $?
fi
- printf "%s\r\n" "$msg" >&3
+ printf "%s\r\n" "$msg" >&$_ircbot_fd
return $?
}
_readmsg() {
local line
- IFS= read -r -u 3 -t "${IRCBOT_READ_TIMEOUT:-300}" line
+ IFS= read -r -u $_ircbot_fd -t "${IRCBOT_READ_TIMEOUT:-300}" line
success=$?
printf "%s\n" "$line" | trimrn
return $success