Step to add ufw rules

This commit is contained in:
2021-03-31 16:22:45 +02:00
parent 90bff659de
commit 14668700a7

View File

@@ -90,6 +90,22 @@ step_2() {
} }
v3AuthLoc="/var/lib/snmp/snmpd.conf" v3AuthLoc="/var/lib/snmp/snmpd.conf"
step_5_info() {
echo "Add ufw rules for port 161 udp [INTERFACE]"
echoinfo " [INTERFACE] (default: eth0)"
}
step_5_alias() { ALIAS="ufw"; }
step_5() {
shift
local lInterface="eth0"
[ ! -z "$1" ] && lInterface="$1"
# Check if interface exists
ip -br a | grep -E "^$lInterface" >>/dev/null 2>&1
endReturn -o $? "Interface $lInterface does not exist"
exe ufw allow in on $lInterface to any port 161 proto udp comment "snmp"
}
step_20_info() { echo "Extend $toolName for Raspberry Pi"; } step_20_info() { echo "Extend $toolName for Raspberry Pi"; }
step_20_alias() { ALIAS="raspberry"; } step_20_alias() { ALIAS="raspberry"; }
step_20() { step_20() {