From 96cc06302bba49beffdd0abd00f0fbf31be9a735 Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Sat, 14 Jan 2023 11:32:27 +0100 Subject: [PATCH] correct scrips --- dbp/banunban.sh | 8 ++++---- dbp/cron.sh | 4 +++- dbp/dbp.ini | 2 +- install.sh | 1 + 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/dbp/banunban.sh b/dbp/banunban.sh index a2ef686..d8faa3e 100755 --- a/dbp/banunban.sh +++ b/dbp/banunban.sh @@ -2,7 +2,7 @@ usage() { echo "Usage: $0 [-f dbp.ini] -d [ban|unban] -i IP" 1>&2; exit 1; } -while getopts ":f:b:u:" o; do +while getopts ":f:d:i:" o; do case "${o}" in f) INIFILE=${OPTARG} @@ -20,7 +20,7 @@ while getopts ":f:b:u:" o; do done shift $((OPTIND-1)) -if [ -z "${INIFILE}" ] || [ -z "${d}" ] || [ -z "${i}" ]; then +if [ -z "${INIFILE}" ] || [ -z "${DO_BAN}" ] || [ -z "${BAN_IP}" ]; then usage fi @@ -46,10 +46,10 @@ if [ $BAN_UNBAN_ENABLE = "true" ]; then if [ $BAN_UNBAN_SERVICE = "ipban" ]; then if [ $DO_BAN = "ban" ]; then - echo ${BAN_IP} > /opt/ipban/ban.txt + echo ${BAN_IP} >> /opt/ipban/ban.txt fi if [ $DO_BAN = "unban" ]; then - echo ${BAN_IP} > /opt/ipban/unban.txt + echo ${BAN_IP} >> /opt/ipban/unban.txt if [ $BAN_UNBAN_MYSTIC = "true" ]; then sed -e "/${BAN_IP}/d" -i ${MYSTIC_DIR}/data/blacklist.txt fi diff --git a/dbp/cron.sh b/dbp/cron.sh index a664c83..3363b24 100755 --- a/dbp/cron.sh +++ b/dbp/cron.sh @@ -36,6 +36,7 @@ MRCCHAT_KEEP=`${MYSTIC_DIR}/inimod r ${INIFILE} -S MrcChatLog -k RetentionTime - NODE_ENABLE=`${MYSTIC_DIR}/inimod r ${INIFILE} -S GeneralDbP -k NodeLog --silent` NODE_COUNT=`${MYSTIC_DIR}/inimod r ${INIFILE} -S NodeLog -k MaxNodes --silent` NODE_KEEP=`${MYSTIC_DIR}/inimod r ${INIFILE} -S NodeLog -k RetentionTime --silent` +NODE_START=0 IP2L_ENABLE=`${MYSTIC_DIR}/inimod r ${INIFILE} -S GeneralDbP -k Ip2Location --silent` IP2L_TOKEN=`${MYSTIC_DIR}/inimod r ${INIFILE} -S Ip2Location -k Token --silent` @@ -80,7 +81,8 @@ if [ $MRCCHAT_ENABLE = "true" ]; then fi if [ $NODE_ENABLE = "true" ]; then - for i in {0..${NODE_COUNT}} + + for i in $(eval echo "{$NODE_START..$NODE_COUNT}") do touch ${MYSTIC_DIR}/logs/node${i}.${NOW}.log touch ${MYSTIC_DIR}/logs/node${i}.${TOMORROW}.log diff --git a/dbp/dbp.ini b/dbp/dbp.ini index 0855d4e..de36333 100644 --- a/dbp/dbp.ini +++ b/dbp/dbp.ini @@ -44,7 +44,7 @@ RetentionTime=7 RetentionTime=7 [BanUnbanIP] -;Set the banning Service to fail2ban or banip +;Set the banning Service to fail2ban or ipban ; depends on what you seleted in the install stage BanningService=fail2ban diff --git a/install.sh b/install.sh index faf2a9f..7a5ee3d 100644 --- a/install.sh +++ b/install.sh @@ -393,6 +393,7 @@ apt-get install -y xmlstarlet &>/dev/null sed -i '/yum/d' /usr/local/src/mystic/ipban-install.sh &>/dev/null sed -i '/systemctl/d' /usr/local/src/mystic/ipban-install.sh &>/dev/null sed -e 's!sudo !!g' -i /usr/local/src/mystic/ipban-install.sh &>/dev/null +sed -e 's!-qq!-qqo!g' -i /usr/local/src/mystic/ipban-install.sh &>/dev/null sed -i '/nano/d' /usr/local/src/mystic/ipban-install.sh &>/dev/null bash /usr/local/src/mystic/ipban-install.sh &>/dev/null if [ -z "${IPBAN_GROUP}" ]; then