From b013d92cb8ca2f3016be037fa63fd915e239f4f3 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Mon, 20 May 2019 16:51:49 -0600 Subject: [PATCH] beginning of config script --- f2g-config.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 f2g-config.sh diff --git a/f2g-config.sh b/f2g-config.sh new file mode 100644 index 0000000..260e2c7 --- /dev/null +++ b/f2g-config.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +####### +### Copy customized jails, filters and action configuration files to fail2ban +### directory and activate them +####### + + +### set script output colours +normal="\e[0m" +bold="\e[1m" +default="\e[39m" +err="\e[1;31m" +warn="\e[1;93m" +ok="\e[32m" +lit="\e[93m" +op="\e[39m" +info="\e[96m" +note="\e[95m" + + +### functions + +### end of functions + + +### pre-requisites +# exit script if fail2ban is not installed +if ! [ -x "$(command -v fail2ban-client)" ]; then + echo + echo -e "${err}Cannot find fail2ban, is it installed? Exiting script." \ + "${normal}" + echo + exit 1 +fi + +# check if running as root +if [ "$(id -u)" -ne 0 ]; then + echo + echo -e "${err}This script MUST be run as ROOT. Exiting.${normal}" + echo + exit 2 +fi +