Skip to content

Commit

Permalink
Merge pull request #140 from mekanix/feature/pre_down
Browse files Browse the repository at this point in the history
Add pre_down hook
  • Loading branch information
mekanix committed May 19, 2020
2 parents 99170a6 + e2479aa commit aa9887d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions mk/jail-service.mk
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,15 @@ provision: setup
@${MAKE} ${MAKEFLAGS} provision-${provisioner}
.endfor

.if target(pre_down)
down: setup pre_down
.else
down: setup
.endif
@sudo cbsd jstop ${SERVICE} || true
.if target(post_down)
@${MAKE} ${MAKEFLAGS} post_down
.endif

destroy:
@rm -f cbsd.conf .provisioned
Expand Down
2 changes: 1 addition & 1 deletion templates/export-ports.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ done


if [ ! -z "${EXPORTED_PORTS}" ]; then
echo "rdr pass inet proto tcp from any to any port { ${EXPORTED_PORTS} } -> ${jname}.${DOMAIN}" | pfctl -a "cbsd/${jname}" -f -
echo "rdr pass inet proto { tcp, udp } from any to any port { ${EXPORTED_PORTS} } -> ${jname}.${DOMAIN}" | pfctl -a "cbsd/${jname}" -f -
fi

0 comments on commit aa9887d

Please sign in to comment.