updated to remove port and add service for firewall

This commit is contained in:
2018-12-13 13:23:06 -05:00
parent b8e85a672c
commit 25baa1335b

View File

@@ -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"