updated to remove port and add service for firewall
This commit is contained in:
7
snmp.sh
7
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"
|
||||
|
||||
Reference in New Issue
Block a user