Commit 7a9443b4 authored by Valentino Lauciani's avatar Valentino Lauciani
Browse files

Update

parent 6d084095
......@@ -120,36 +120,38 @@ configure_nginx()
configure_iptables()
{
echo_date "Check \"iptables\" installation:"
echo_date "Configuring \"iptables\":"
echo " check installation:"
dpkg-query -W -f='${Status} ${Version}\n' iptables
RETURNED_VAL=${?}
echo "RETURNED_VAL:${RETURNED_VAL}"
echo_date "Done"
if (( ${RETURNED_VAL} == 0 )) && [ -d ${GITBASEDIR}/cnt.rm.ingv.it/root/etc/firewall/ ]; then
echo ""
if (( ${RETURNED_VAL} == 0 )) && [ -d ${GITBASEDIRCURREPO}/cnt.rm.ingv.it/root/etc/firewall/ ]; then
echo_date "Configuring \"iptables\":"
mkdir /etc/firewall
cd /etc/firewall
ln -s ${GITBASEDIR}/cnt.rm.ingv.it/root/etc/firewall/firewall.openall.sh
ln -s ${GITBASEDIR}/cnt.rm.ingv.it/root/etc/firewall/firewall.rules_azure.sh firewall.rules.sh
ln -s ${GITBASEDIRCURREPO}/cnt.rm.ingv.it/root/etc/firewall/firewall.openall.sh
ln -s ${GITBASEDIRCURREPO}/cnt.rm.ingv.it/root/etc/firewall/firewall.rules_azure.sh firewall.rules.sh
cd /etc/init.d
ln -s ${GITBASEDIR}/cnt.rm.ingv.it/root/etc/init.d/iptables
ln -s ${GITBASEDIRCURREPO}/cnt.rm.ingv.it/root/etc/init.d/iptables
/etc/init.d/iptables start
echo_date "Done"
fi
echo_date "Done"
echo ""
}
configure_fail2ban()
{
echo_date "Check \"fail2ban\" installation:"
echo_date "Configuring \"fail2ban\":"
echo " check installation:"
dpkg-query -W -f='${Status} ${Version}\n' fail2ban
RETURNED_VAL=${?}
echo "RETURNED_VAL:${RETURNED_VAL}"
echo_date ""
echo ""
if (( ${RETURNED_VAL} == 0 )) && [ -d ${GITBASEDIR}/cnt.rm.ingv.it/root/etc/fail2ban/ ]; then
if (( ${RETURNED_VAL} == 0 )) && [ -d ${GITBASEDIRCURREPO}/cnt.rm.ingv.it/root/etc/fail2ban/ ]; then
service fail2ban stop
DIR_FAIL2BAN="/etc/fail2ban"
......@@ -157,7 +159,7 @@ configure_fail2ban()
cd ${DIR_FAIL2BAN}
if [ -f jail.local ]; then
mv jail.local jail.local__original
ln -s ${GITBASEDIR}/cnt.rm.ingv.it/root/etc/fail2ban/jail.local
ln -s ${GITBASEDIRCURREPO}/cnt.rm.ingv.it/root/etc/fail2ban/jail.local
fi
fi
......@@ -170,7 +172,7 @@ configure_fail2ban()
if [ -f ${CONFIG_FILE} ]; then
mv ${CONFIG_FILE} ${CONFIG_FILE}__original
fi
ln -s ${GITBASEDIR}/cnt.rm.ingv.it/root/etc/fail2ban/filter.d/${CONFIG_FILE}
ln -s ${GITBASEDIRCURREPO}/cnt.rm.ingv.it/root/etc/fail2ban/filter.d/${CONFIG_FILE}
done
fi
......@@ -183,12 +185,14 @@ configure_fail2ban()
if [ -f ${CONFIG_FILE} ]; then
mv ${CONFIG_FILE} ${CONFIG_FILE}__original
fi
ln -s ${GITBASEDIR}/cnt.rm.ingv.it/root/etc/fail2ban/action.d/${CONFIG_FILE}
ln -s ${GITBASEDIRCURREPO}/cnt.rm.ingv.it/root/etc/fail2ban/action.d/${CONFIG_FILE}
done
fi
service fail2ban start
fi
echo_date "Done"
echo ""
}
SEPLINE="============================================="
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment