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