Update snmp.sh

This commit is contained in:
2018-12-12 19:39:50 -05:00
parent 91f862acd2
commit e3d80ba745

17
snmp.sh
View File

@@ -8,8 +8,21 @@ if [ "$EUID" -ne 0 ]; then
exit
fi
# isntall curl and snmpd
apt install -y snmpd curl
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
else
echo "Unable to determine linux distro"
exit
fi
# back the original config file
mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.bak