From 5c5e0898d23a4c34a9d8688c13fa37364984f5d6 Mon Sep 17 00:00:00 2001 From: Gardouille Date: Wed, 16 Sep 2015 18:46:28 +0200 Subject: [PATCH] firewall: allow SNMP requests if cupsd service is available. --- firewall | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/firewall b/firewall index e63e461..f8ffb97 100755 --- a/firewall +++ b/firewall @@ -165,8 +165,10 @@ fw_start() { #### tftp allowed #$IPT -A INPUT -j ACCEPT -p udp -i "${ILAN}" -d "${IPLAN}" --dport 69 -m state --state NEW -m comment --comment "TFTPD in" - #### Printers - $IPT -A INPUT -j ACCEPT -p udp -i "${ILAN}" -d "${IPLAN}" --sport 161 -m state --state NEW -m comment --comment "SNMP IN" + if [ $(command -v cupsd) ]; then + #### Printers + $IPT -A INPUT -j ACCEPT -p udp -i "${ILAN}" -d "${IPLAN}" --sport 161 -m state --state NEW -m comment --comment "SNMP IN" + fi ######################### ## {Multi,Broad}cast ## @@ -255,9 +257,10 @@ fw_start() { $IPT -A OUTPUT -j ACCEPT -p udp -o "${ILAN}" -s "${IPLAN}" --dport 32767 -m state --state NEW -m comment --comment "NFS mountd out" fi -# #### Printers -# $IPT -A OUTPUT -j ACCEPT -p udp -o "${ILAN}" -s "${IPLAN}" --dport 161 -m state --state NEW -m comment --comment "SNMP OUT" -# + if [ $(command -v cupsd) ]; then + #### Printers + $IPT -A OUTPUT -j ACCEPT -p udp -o "${ILAN}" -s "${IPLAN}" --dport 161 -m state --state NEW -m comment --comment "SNMP OUT" + fi }