summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2018-09-27 00:01:21 -0400
committerbill-auger <mr.j.spam.me@gmail.com>2018-10-02 19:05:09 -0400
commite5f99872193ae847b8eb47dc22d5d2d5a708b095 (patch)
treed5b98d544d8de2728294694387221562f444dab1
parent9b4143cbd11ee5dc03d235b1fe289a83ebab512a (diff)
allow custom ii dir
-rw-r--r--modules/m_spamfilter.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/modules/m_spamfilter.sh b/modules/m_spamfilter.sh
index 97f6018..f0f0ca3 100644
--- a/modules/m_spamfilter.sh
+++ b/modules/m_spamfilter.sh
@@ -31,7 +31,7 @@
# relay configuration
readonly RELAY_NICK='a-user'
-readonly II_DIR=/home/pbot/irc/${config_server}
+readonly II_ROOT_DIR=/home/pbot/irc
readonly IS_RELAY_BOT_REGISTERED=0
# generic spam-like regexes
@@ -75,6 +75,7 @@ readonly II_LOG_REGEX='[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2} '
# runtime constants
readonly FILTER_CHANNELS="${config_module_spamfilter_channels}"
+readonly II_DIR=${II_ROOT_DIR}/${config_server}
readonly BOT_PASS="${config_server_passwd}"
@@ -120,11 +121,11 @@ DBG_SPAMFILTER_JOIN
DBG_SPAMFILTER_SET_MODE
# launch a second bot (not op) so we can compare the chat logs
- [[ -f ${II_DIR}/in ]] && printf "/quit\n" > ${II_DIR}/in ; sleep 2 ;
- pkill ii ; sleep 2 ;
- ii -s ${config_server} -n ${RELAY_NICK} -f "Spam Filter" & sleep 5 ;
+ [[ -f ${II_DIR}/in ]] && printf "/quit\n" > ${II_DIR}/in ; sleep 2 ;
+ pkill ii ; sleep 2 ;
+ ii -s ${config_server} -n ${RELAY_NICK} -f "Spam Filter" -i ${II_ROOT_DIR} & sleep 5 ;
if (( ${IS_RELAY_BOT_REGISTERED} ))
- then printf "/j NickServ IDENTIFY %s\n" ${BOT_PASS} > ${II_DIR}/in ; sleep 2 ;
+ then printf "/j NickServ IDENTIFY %s\n" ${BOT_PASS} > ${II_DIR}/in ; sleep 2 ;
fi
printf "/j %s\n" "${channel}" > ${II_DIR}/in