diff options
Diffstat (limited to 'noarch/firewall-suse')
-rwxr-xr-x | noarch/firewall-suse | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/noarch/firewall-suse b/noarch/firewall-suse new file mode 100755 index 0000000..509eb56 --- /dev/null +++ b/noarch/firewall-suse @@ -0,0 +1,39 @@ +SERVICE_DIR="/etc/sysconfig/SuSEfirewall2.d/services" +SERVICE_FILE="${SERVICE_DIR}/smfp" + +plug_hifw_suse() { + # check direstory exists + if ! [ -d "$SERVICE_DIR" ]; then + return 1 + fi + + # turn off our servcie + yast2 firewall services remove zone=EXT service=service:smfp + + # delete our service + rm -f "$SERVICE_FILE" +} + +make_hifw_suse() { +# $1 port + # check direstory exists + if ! [ -d "$SERVICE_DIR" ]; then + log_message "cannot find directory $SERVICE_DIR" + return 1 + fi + + # create new service + touch "$SERVICE_FILE" + if ! [ -f "$SERVICE_FILE" ] ; then + return 1 + fi + + # full new service file + echo "## Name: SMFP device discovery" > "$SERVICE_FILE" + echo "## Description: Open UPD port for answers to broadcast requests coming through SNMP protocol" >> "$SERVICE_FILE" + echo "UDP=\"$1\"" >> "$SERVICE_FILE" + + # turn on new servcie + yast2 firewall services add zone=EXT service=service:smfp +} + |