mirror of
https://codeberg.org/scip/jaildk.git
synced 2025-12-17 04:31:02 +01:00
fix #21: only execute ipfw stuff if there's an ipfw.conf
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
version=2.0.0
|
version=2.0.1
|
||||||
|
|
||||||
# this will be completed during build. Don't touch it, just execute
|
# this will be completed during build. Don't touch it, just execute
|
||||||
# make and use the resulting script!
|
# make and use the resulting script!
|
||||||
@@ -2067,6 +2067,11 @@ jaildk_ipfw() {
|
|||||||
|
|
||||||
jail=$1
|
jail=$1
|
||||||
|
|
||||||
|
if ! test -f "$j/etc/$jail/ipfw.conf"; then
|
||||||
|
# dont do anything in non-ipf shells
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
OPTIND=1; while getopts "m:" arg; do
|
OPTIND=1; while getopts "m:" arg; do
|
||||||
case $arg in
|
case $arg in
|
||||||
m) mode=${OPTARG};;
|
m) mode=${OPTARG};;
|
||||||
@@ -2078,21 +2083,19 @@ jaildk_ipfw() {
|
|||||||
usage_ipfw
|
usage_ipfw
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test -f "$j/etc/$jail/ipfw.conf"; then
|
echo
|
||||||
echo
|
bold "Managing IPFW Rules..."
|
||||||
bold "Managing IPFW Rules..."
|
case $mode in
|
||||||
case $mode in
|
start)
|
||||||
start)
|
ipfw_delete $jail "y"
|
||||||
ipfw_delete $jail "y"
|
ipfw_add $jail
|
||||||
ipfw_add $jail
|
;;
|
||||||
;;
|
stop)
|
||||||
stop)
|
ipfw_delete $jail
|
||||||
ipfw_delete $jail
|
;;
|
||||||
;;
|
esac
|
||||||
esac
|
bold "... done"
|
||||||
bold "... done"
|
echo
|
||||||
echo
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ipfw_add() {
|
ipfw_add() {
|
||||||
|
|||||||
Reference in New Issue
Block a user