net-mgmt/net-snmp: Fix scenario where a user does not have a config in the default location

PR:		280284
Reported by:	gebhart@secnetix.de
This commit is contained in:
Ryan Steinmetz 2024-07-19 14:03:04 -04:00
parent 5e2c397a9b
commit 9364edfdf0
No known key found for this signature in database
GPG key ID: 1EF8BA6BD02846D7
2 changed files with 5 additions and 2 deletions

View file

@ -1,7 +1,7 @@
PORTNAME= snmp PORTNAME= snmp
PORTVERSION= 5.9.4 PORTVERSION= 5.9.4
PORTEPOCH= 1 PORTEPOCH= 1
PORTREVISION= 5 PORTREVISION= 6
CATEGORIES= net-mgmt CATEGORIES= net-mgmt
MASTER_SITES= SF/net-${PORTNAME}/net-${PORTNAME}/${PORTVERSION} \ MASTER_SITES= SF/net-${PORTNAME}/net-${PORTNAME}/${PORTVERSION} \
ZI ZI

View file

@ -77,7 +77,10 @@ net_snmpd_precmd() {
done done
# -c does not override the default config file. # -c does not override the default config file.
# if it exists, sanity check
if [ -f %%PREFIX%%/share/snmp/snmpd.conf ]; then
check_conffile %%PREFIX%%/share/snmp/snmpd.conf check_conffile %%PREFIX%%/share/snmp/snmpd.conf
fi
for conffile in ${snmpd_conffile}; do for conffile in ${snmpd_conffile}; do
check_conffile ${conffile} check_conffile ${conffile}
if [ -f "${conffile}" -a -s "${conffile}" ]; then if [ -f "${conffile}" -a -s "${conffile}" ]; then