diff options
| -rw-r--r-- | src/bbfw.conf-example.in | 6 | ||||
| -rwxr-xr-x | src/bbfw.in | 14 |
2 files changed, 18 insertions, 2 deletions
diff --git a/src/bbfw.conf-example.in b/src/bbfw.conf-example.in index 867cb91..e8a62fa 100644 --- a/src/bbfw.conf-example.in +++ b/src/bbfw.conf-example.in | |||
| @@ -39,4 +39,10 @@ | |||
| 39 | # quiet = no | 39 | # quiet = no |
| 40 | 40 | ||
| 41 | 41 | ||
| 42 | # The `verbose` option enables verbose output for utilities which support | ||
| 43 | # verbose flags (currently only iptables). To enable verbose output, | ||
| 44 | # uncomment the line below and change the value to 'yes'. | ||
| 45 | # verbose = yes | ||
| 46 | |||
| 47 | |||
| 42 | # end of configuration | 48 | # end of configuration |
diff --git a/src/bbfw.in b/src/bbfw.in index f2a5f61..ae5ce9a 100755 --- a/src/bbfw.in +++ b/src/bbfw.in | |||
| @@ -81,6 +81,7 @@ export PATH | |||
| 81 | FW_PREFIX=@sysconfdir@/firewall.d/ | 81 | FW_PREFIX=@sysconfdir@/firewall.d/ |
| 82 | FW_CONF=@sysconfdir@/bbfw.conf | 82 | FW_CONF=@sysconfdir@/bbfw.conf |
| 83 | FW_QUIET=no | 83 | FW_QUIET=no |
| 84 | FW_VERBOSE=no | ||
| 84 | 85 | ||
| 85 | 86 | ||
| 86 | ########### | 87 | ########### |
| @@ -206,8 +207,8 @@ load() | |||
| 206 | 207 | ||
| 207 | case "${TYPE}" in | 208 | case "${TYPE}" in |
| 208 | 'ipset') clean_file ${FILE} |ipset -! restore;; | 209 | 'ipset') clean_file ${FILE} |ipset -! restore;; |
| 209 | 'iptables') clean_file ${FILE} |iptables-restore -n;; | 210 | 'iptables') clean_file ${FILE} |iptables-restore -n ${FW_VERBOSE};; |
| 210 | 'ip6tables') clean_file ${FILE} |ip6tables-restore -n;; | 211 | 'ip6tables') clean_file ${FILE} |ip6tables-restore -n ${FW_VERBOSE};; |
| 211 | *) ;; | 212 | *) ;; |
| 212 | esac | 213 | esac |
| 213 | } | 214 | } |
| @@ -351,6 +352,7 @@ stop() { | |||
| 351 | # sets options from configuration file | 352 | # sets options from configuration file |
| 352 | FW_PREFIX="$( config_option firewall_dir "${FW_PREFIX}" )" | 353 | FW_PREFIX="$( config_option firewall_dir "${FW_PREFIX}" )" |
| 353 | FW_QUIET="$( config_option quiet "${FW_QUIET}" A-Z a-z )" | 354 | FW_QUIET="$( config_option quiet "${FW_QUIET}" A-Z a-z )" |
| 355 | FW_VERBOSE="$( config_option verbose "${FW_VERBOSE}" A-Z a-z )" | ||
| 354 | 356 | ||
| 355 | 357 | ||
| 356 | # checks and normalizes options | 358 | # checks and normalizes options |
| @@ -360,6 +362,14 @@ elsif test "x${FW_QUIET}" != "xno";then | |||
| 360 | echo "${PROGRAM_NAME}: invalid value for option 'quiet'" 1>&2 | 362 | echo "${PROGRAM_NAME}: invalid value for option 'quiet'" 1>&2 |
| 361 | exit 1 | 363 | exit 1 |
| 362 | fi | 364 | fi |
| 365 | if test "x${FW_VERBOSE}" == "xno";then | ||
| 366 | unset FW_VERBOSE | ||
| 367 | elsif test "x${FW_VERBOSE}" != "xno";then | ||
| 368 | echo "${PROGRAM_NAME}: invalid value for verbose 'quiet'" 1>&2 | ||
| 369 | exit 1 | ||
| 370 | else | ||
| 371 | FW_VERBOSE=-v | ||
| 372 | fi | ||
| 363 | 373 | ||
| 364 | 374 | ||
| 365 | case "$1" in | 375 | case "$1" in |
