Skip to content

Commit 0f92fc5

Browse files
authored
Merge pull request #2355 from MorganaFuture/morganaFuture/fix/check-config-file-existence
Fix: check config file existence
2 parents 01b4f96 + 7f3aa1f commit 0f92fc5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

scripts/tempesta.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,13 +344,22 @@ stop_tfw_logger()
344344
fi
345345
}
346346

347+
check_configuration_file_presense()
348+
{
349+
if [ ! -f "$tfw_cfg_path" ]; then
350+
error "Configuration file $tfw_cfg_path does not exist. Please create a configuration file before starting Tempesta FW."
351+
fi
352+
}
353+
347354
start()
348355
{
349356
echo "Starting Tempesta..."
350357

351358
TFW_STATE=$(sysctl net.tempesta.state 2> /dev/null)
352359
TFW_STATE=${TFW_STATE##* }
353360
TFW_LOGGER_EXEC=$(expr "$TFW_STATE" != "start")
361+
362+
check_configuration_file_presense
354363

355364
if [[ -z ${TFW_STATE} ]]; then
356365
setup
@@ -397,6 +406,7 @@ stop()
397406

398407
reload()
399408
{
409+
check_configuration_file_presense
400410
update_js_challenge_templates
401411
echo "Running live reconfiguration of Tempesta..."
402412

0 commit comments

Comments
 (0)