correct scrips

This commit is contained in:
Mario Fetka 2023-01-14 11:32:27 +01:00
parent 40f33aa74e
commit 96cc06302b
4 changed files with 9 additions and 6 deletions

View File

@ -2,7 +2,7 @@
usage() { echo "Usage: $0 [-f dbp.ini] -d [ban|unban] -i IP" 1>&2; exit 1; } 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 case "${o}" in
f) f)
INIFILE=${OPTARG} INIFILE=${OPTARG}
@ -20,7 +20,7 @@ while getopts ":f:b:u:" o; do
done done
shift $((OPTIND-1)) shift $((OPTIND-1))
if [ -z "${INIFILE}" ] || [ -z "${d}" ] || [ -z "${i}" ]; then if [ -z "${INIFILE}" ] || [ -z "${DO_BAN}" ] || [ -z "${BAN_IP}" ]; then
usage usage
fi fi
@ -46,10 +46,10 @@ if [ $BAN_UNBAN_ENABLE = "true" ]; then
if [ $BAN_UNBAN_SERVICE = "ipban" ]; then if [ $BAN_UNBAN_SERVICE = "ipban" ]; then
if [ $DO_BAN = "ban" ]; then if [ $DO_BAN = "ban" ]; then
echo ${BAN_IP} > /opt/ipban/ban.txt echo ${BAN_IP} >> /opt/ipban/ban.txt
fi fi
if [ $DO_BAN = "unban" ]; then 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 if [ $BAN_UNBAN_MYSTIC = "true" ]; then
sed -e "/${BAN_IP}/d" -i ${MYSTIC_DIR}/data/blacklist.txt sed -e "/${BAN_IP}/d" -i ${MYSTIC_DIR}/data/blacklist.txt
fi fi

View File

@ -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_ENABLE=`${MYSTIC_DIR}/inimod r ${INIFILE} -S GeneralDbP -k NodeLog --silent`
NODE_COUNT=`${MYSTIC_DIR}/inimod r ${INIFILE} -S NodeLog -k MaxNodes --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_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_ENABLE=`${MYSTIC_DIR}/inimod r ${INIFILE} -S GeneralDbP -k Ip2Location --silent`
IP2L_TOKEN=`${MYSTIC_DIR}/inimod r ${INIFILE} -S Ip2Location -k Token --silent` IP2L_TOKEN=`${MYSTIC_DIR}/inimod r ${INIFILE} -S Ip2Location -k Token --silent`
@ -80,7 +81,8 @@ if [ $MRCCHAT_ENABLE = "true" ]; then
fi fi
if [ $NODE_ENABLE = "true" ]; then if [ $NODE_ENABLE = "true" ]; then
for i in {0..${NODE_COUNT}}
for i in $(eval echo "{$NODE_START..$NODE_COUNT}")
do do
touch ${MYSTIC_DIR}/logs/node${i}.${NOW}.log touch ${MYSTIC_DIR}/logs/node${i}.${NOW}.log
touch ${MYSTIC_DIR}/logs/node${i}.${TOMORROW}.log touch ${MYSTIC_DIR}/logs/node${i}.${TOMORROW}.log

View File

@ -44,7 +44,7 @@ RetentionTime=7
RetentionTime=7 RetentionTime=7
[BanUnbanIP] [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 ; depends on what you seleted in the install stage
BanningService=fail2ban BanningService=fail2ban

View File

@ -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 '/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 -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!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 sed -i '/nano/d' /usr/local/src/mystic/ipban-install.sh &>/dev/null
bash /usr/local/src/mystic/ipban-install.sh &>/dev/null bash /usr/local/src/mystic/ipban-install.sh &>/dev/null
if [ -z "${IPBAN_GROUP}" ]; then if [ -z "${IPBAN_GROUP}" ]; then