nix fail2ban

This commit is contained in:
AJ ONeal 2017-05-25 11:17:40 -06:00
parent 59e420471b
commit 228bdc5e1c
1 changed files with 35 additions and 34 deletions

View File

@ -12,7 +12,8 @@
NODEJS_NAME="node"
NODEJS_BASE_URL="https://nodejs.org"
BASE_URL="https://git.daplie.com/coolaj86/node-install-script/raw/master"
NO_FAIL2BAN=""
#NO_FAIL2BAN=""
NO_FAIL2BAN="nope"
OS="unsupported"
ARCH=""
NODEJS_VER=""
@ -188,39 +189,39 @@ fi
# DEPENDENCIES #
################
if [ -z "$(which fail2ban-server | grep fail2ban)" ]; then
echo ""
echo "Your server didn't come with fail2ban preinstalled!!!"
echo "Among other things, fail2ban secures ssh so that your server isn't reaped by botnets."
echo ""
echo "Since you're obviously connecting this computer to a network, you should install fail2ban before continuing"
echo ""
echo "Install fail2ban? [Y/n]"
echo "(if unsure, just hit [enter])"
read INSTALL_FAIL2BAN
if [ "n" == "${INSTALL_FAIL2BAN}" ] || [ "no" == "${INSTALL_FAIL2BAN}" ] || [ "N" == "${INSTALL_FAIL2BAN}" ] || [ "NO" == "${INSTALL_FAIL2BAN}" ]; then
echo ""
echo "I don't think you understand: This is important."
echo ""
echo "Your server will be under constant attack by botnets via ssh."
echo "It only takes a few extra seconds to install and the defaults are adequate for protecting you."
echo ""
echo "Change your mind?"
echo "Ready to install fail2ban? [Y/n]"
read INSTALL_FAIL2BAN
if [ "n" == "${INSTALL_FAIL2BAN}" ] || [ "no" == "${INSTALL_FAIL2BAN}" ] || [ "N" == "${INSTALL_FAIL2BAN}" ] || [ "NO" == "${INSTALL_FAIL2BAN}" ]; then
clear
echo "you make me sad :-("
sleep 0.5
echo "but whatever, it's your funeral..."
sleep 1
NO_FAIL2BAN="nope"
else
echo "Phew, dodged the bullet on that one... Will install fail2ban.. :-)"
fi
fi
fi
#if [ -z "$(which fail2ban-server | grep fail2ban)" ]; then
# echo ""
# echo "Your server didn't come with fail2ban preinstalled!!!"
# echo "Among other things, fail2ban secures ssh so that your server isn't reaped by botnets."
# echo ""
# echo "Since you're obviously connecting this computer to a network, you should install fail2ban before continuing"
# echo ""
# echo "Install fail2ban? [Y/n]"
# echo "(if unsure, just hit [enter])"
# read INSTALL_FAIL2BAN
#
# if [ "n" == "${INSTALL_FAIL2BAN}" ] || [ "no" == "${INSTALL_FAIL2BAN}" ] || [ "N" == "${INSTALL_FAIL2BAN}" ] || [ "NO" == "${INSTALL_FAIL2BAN}" ]; then
# echo ""
# echo "I don't think you understand: This is important."
# echo ""
# echo "Your server will be under constant attack by botnets via ssh."
# echo "It only takes a few extra seconds to install and the defaults are adequate for protecting you."
# echo ""
# echo "Change your mind?"
# echo "Ready to install fail2ban? [Y/n]"
# read INSTALL_FAIL2BAN
# if [ "n" == "${INSTALL_FAIL2BAN}" ] || [ "no" == "${INSTALL_FAIL2BAN}" ] || [ "N" == "${INSTALL_FAIL2BAN}" ] || [ "NO" == "${INSTALL_FAIL2BAN}" ]; then
# clear
# echo "you make me sad :-("
# sleep 0.5
# echo "but whatever, it's your funeral..."
# sleep 1
# NO_FAIL2BAN="nope"
# else
# echo "Phew, dodged the bullet on that one... Will install fail2ban.. :-)"
# fi
# fi
#fi
bash "/tmp/${INSTALL_DEPS_FILE}" "${NO_FAIL2BAN}"