#!/sbin/openrc-run
# The ports this machine answers on. Written from scratch on every boot
# rather than restored from a file, because where ssh listens can have
# changed since the last one, and a rule set that names the wrong port is
# how a machine is lost to its own firewall.

description="The ports this machine answers on"

depend() {
	need localmount
	before net
}

start() {
	ebegin "Putting the phone system's ports in place"
	/usr/sbin/nuxpbx-firewall apply
	eend $?
}

stop() {
	ebegin "Opening this machine up again"
	/usr/sbin/nuxpbx-firewall remove
	eend $?
}

status() {
	/usr/sbin/nuxpbx-firewall show
}
