#!/bin/bash

# bash <(curl -s https://repo.scorpia.network/tools/activate-snmp--debian-10.sh)
# bash <(curl -s https://repo.scorpia.network/tools/activate-snmp--debian-11.sh)

clear

echo -e "username                                   :       \c"
read username
echo -e "authPass                                   :       \c"
read authPass
echo -e "privPass                                   :       \c"
read privPass

systemctl stop snmpd

rm -f /usr/share/snmp/snmpd.conf
mkdir /snmp
net-snmp-config --create-snmpv3-user -ro -A $authPass -X $privPass -a SHA -x AES $username
mv /snmp/snmpd.conf /usr/share/snmp/snmpd.conf

clear

systemctl restart snmpd

exit 0
