From 25baa1335b91778a3264a7834cb1c327ef073060 Mon Sep 17 00:00:00 2001 From: "Gaunt, John" Date: Thu, 13 Dec 2018 13:23:06 -0500 Subject: [PATCH] updated to remove port and add service for firewall --- snmp.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/snmp.sh b/snmp.sh index b36f2af..89cf55f 100644 --- a/snmp.sh +++ b/snmp.sh @@ -8,17 +8,12 @@ if [ "$EUID" -ne 0 ]; then exit fi -if [ "$EUID" -ne 0 ]; then - echo "Please run as root" - exit -fi - if [ -f /etc/debian_version ]; then apt update apt install -y snmpd curl elif [ -f /etc/redhat-release ]; then yum install -y net-snmp net-snmp-utils - firewall-cmd --zone=public --add-port=161/udp --permanent + firewall-cmd --zone=public --add-service=snmp --permanent firewall-cmd --reload else echo "Unable to determine linux distro"