From 9d814940f9b6c0502b06047e7971384ecf2fec06 Mon Sep 17 00:00:00 2001 From: ChiefGyk Date: Tue, 28 Jun 2016 18:54:47 -0400 Subject: [PATCH] Made script check to see if you are running as root --- install.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/install.sh b/install.sh index d8dbf09c..ce2ad069 100755 --- a/install.sh +++ b/install.sh @@ -1,6 +1,14 @@ # Add Blocklist.de malicious IP Addresses to Daily Crontab # Also IPtables-persistent to save IP addresses upon reboot # Added by Alon "ChiefGyk" Ganon +# Are we running as root? +if [[ $EUID -ne 0 ]]; then + echo "This script must be run as root. Please re-run like this:" + echo + echo "sudo $0" + echo + exit +fi cp sync-fail2ban /etc/cron.daily/sync-fail2ban chmod a+x /etc/cron.daily/sync-fail2ban time /etc/cron.daily/sync-fail2ban