summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2019-09-23 17:44:45 -0400
committerbill-auger <mr.j.spam.me@gmail.com>2019-11-27 23:42:50 -0500
commit8375e8e21aa40c6bc4c4c816620ae40696ed929d (patch)
tree6ccbc66f4dd79e5c180dceca0fef2f018f22627f /lib
parent4b404b554bb09e10e1366691c9990c9abd98122b (diff)
add 'pbot-say' and notification git hook
Diffstat (limited to 'lib')
-rw-r--r--lib/main.sh3
-rw-r--r--lib/send.sh8
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/main.sh b/lib/main.sh
index ac28f05..36ac055 100644
--- a/lib/main.sh
+++ b/lib/main.sh
@@ -334,11 +334,12 @@ debug_init
log_info_stdout "Loading transport"
source "${config_transport_dir}/${config_transport}.sh"
-source "${config_transport_dir}/transport_plus_ipc.sh.inc" # common transport_read_line()
if [[ $? -ne 0 ]]; then
log_fatal "Couldn't load transport. Couldn't load the file..."
envbot_quit 2
fi
+source "${config_transport_dir}/transport_plus_ipc.sh.inc" # refactored common transport_read_line()
+touch "${IPC_QUEUE_FILE}" || log_error "[MAIN]: ERROR: insufficient permissions on \$IPC_QUEUE_FILE: '${IPC_QUEUE_FILE}' (should be world-writable)."
if ! transport_check_support; then
log_fatal "The transport reported it can't work on this system or with this configuration."
diff --git a/lib/send.sh b/lib/send.sh
index 59f90df..9cbe247 100644
--- a/lib/send.sh
+++ b/lib/send.sh
@@ -181,14 +181,14 @@ send_ipc_msg()
{
if [[ -z "${IPC_NOTICE_CHANNEL}" ]]
then echo '[SEND]: no target channel set in IPC_NOTICE_CHANNEL'
- elif ! touch "${IPC_STORE_FILE}" 2> /dev/null
- then echo "[SEND]: no such file set in IPC_STORE_FILE: '${IPC_STORE_FILE}'"
+ elif ! touch "${IPC_QUEUE_FILE}" 2> /dev/null
+ then echo "[SEND]: no such file set in IPC_QUEUE_FILE: '${IPC_QUEUE_FILE}'"
else
local delay_secs=$1 ; shift ;
local message=$*
local delivery_time=$(( $(date +%s) + ${delay_secs} ))
- echo "${delivery_time} ${IPC_NOTICE_CHANNEL} ${message}" >> "${IPC_STORE_FILE}"
- sort -o "${IPC_STORE_FILE}" "${IPC_STORE_FILE}"
+ echo "${delivery_time} ${IPC_NOTICE_CHANNEL} ${message}" >> "${IPC_QUEUE_FILE}"
+ sort -o "${IPC_QUEUE_FILE}" "${IPC_QUEUE_FILE}"
fi
}