aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDavid M. Syzdek <syzdek@bindlebinaries.com>2019-07-29 13:34:25 -0800
committerDavid M. Syzdek <syzdek@bindlebinaries.com>2019-07-29 13:34:25 -0800
commit3cc86c743a651e413eed6009e9bfa8131daee417 (patch)
tree866d581d5020a42f2f5a8fc9eb06e6afb1371b7a
parentb03c3fbf638847ba1bc2463aa97f5ac00cf3e8aa (diff)
downloadbbfw-3cc86c743a651e413eed6009e9bfa8131daee417.tar.gz
bbfw-3cc86c743a651e413eed6009e9bfa8131daee417.tar.bz2
bbfw-3cc86c743a651e413eed6009e9bfa8131daee417.tar.xz
bbfw-3cc86c743a651e413eed6009e9bfa8131daee417.zip
Revert "Splitting restart into separate function and moving firewall dir check to start() and restart()"
This reverts commit 412c3f95e5392a182e8616313731f4553546913b.
-rwxr-xr-xsrc/bbfw.in24
1 files changed, 6 insertions, 18 deletions
diff --git a/src/bbfw.in b/src/bbfw.in
index ae5ce9a..7f34e9d 100755
--- a/src/bbfw.in
+++ b/src/bbfw.in
@@ -214,25 +214,8 @@ load()
214} 214}
215 215
216 216
217restart() {
218 if test ! -d "${FW_PREFIX}";then
219 echo "${PROGRAM_NAME}: ${FW_PREFIX}: firewall directory does not exist" 1>&2
220 return 1
221 fi
222
223 stop
224 start
225}
226
227
228# Function to start the network: 217# Function to start the network:
229start() { 218start() {
230 # checks for firewall directory
231 if test ! -d "${FW_PREFIX}";then
232 echo "${PROGRAM_NAME}: ${FW_PREFIX}: firewall directory does not exist" 1>&2
233 return 1
234 fi
235
236 # run pre-hooks 219 # run pre-hooks
237 run_hook start ${FW_PREFIX}/global.d/pre-hook "running global pre-hook start ..." 220 run_hook start ${FW_PREFIX}/global.d/pre-hook "running global pre-hook start ..."
238 for FILE in $( find_appfile pre-hook );do 221 for FILE in $( find_appfile pre-hook );do
@@ -356,6 +339,10 @@ FW_VERBOSE="$( config_option verbose "${FW_VERBOSE}" A-Z a-z )"
356 339
357 340
358# checks and normalizes options 341# checks and normalizes options
342if test ! -d "${FW_PREFIX}";then
343 echo "${PROGRAM_NAME}: ${FW_PREFIX}: firewall directory does not exist" 1>&2
344 exit 1
345fi
359if test "x${FW_QUIET}" == "xno";then 346if test "x${FW_QUIET}" == "xno";then
360 unset FW_QUIET 347 unset FW_QUIET
361elsif test "x${FW_QUIET}" != "xno";then 348elsif test "x${FW_QUIET}" != "xno";then
@@ -400,7 +387,8 @@ case "$1" in
400 387
401 'restart') # "restart" restarts the network: 388 'restart') # "restart" restarts the network:
402 echo "${PACKAGE_NAME} ${PACKAGE_VERSION}" | $LOGGER 389 echo "${PACKAGE_NAME} ${PACKAGE_VERSION}" | $LOGGER
403 restart 2>&1 | $LOGGER 390 stop 2>&1 | $LOGGER
391 start 2>&1 | $LOGGER
404 ;; 392 ;;
405 393
406 *) # The default is to bring up all configured interfaces: 394 *) # The default is to bring up all configured interfaces: