Skip to content

Commit 01fdebc

Browse files
committed
Changed: Order of some configuration functions
1 parent 805c8e6 commit 01fdebc

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
- none
1111

12-
## [1.0.0] - 2024-11-23
12+
## [1.0.1] - 2024-12-17
13+
14+
### Changed
15+
16+
- Reorder of some configuration functions
17+
18+
## [1.0.0] - 2024-12-17
1319

1420
### Added
1521

noircon

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
# App version and name
88
APP_NAME="NoirCon"
9-
VERSION=1.0.0
10-
LAST_UPDATED="2024-12-10"
9+
VERSION=1.0.1
10+
LAST_UPDATED="2024-12-17"
1111

1212
# ==============================
1313
# Application Specific Variables
@@ -46,6 +46,9 @@ CHECK_INTERVAL="60s"
4646
# Default timeout interval (in seconds)
4747
TIMEOUT="5s"
4848

49+
# Default check repeat (0=infinite)
50+
REPEAT=0
51+
4952
# Pushover notification options
5053
PUSHOVER_NOTIFICATION=false
5154
PUSHOVER_USER_KEY=
@@ -1306,16 +1309,21 @@ parse_cli_options() {
13061309
# Set the PID file based on final CACHE_DIR
13071310
PID_FILE="$(normalize_path "$CACHE_DIR/$PID_FILE_NAME")"
13081311

1312+
# Process final commands after configuration is completely finalized
1313+
[[ "$EDIT_CONFIG_FILE" = true ]] && edit_file "$CONFIG_FILE"
1314+
[[ "$SHOW_LOG" = true ]] && show_log
1315+
[[ "$SHOW_CONFIG_FILE" = true ]] && show_config_file
1316+
13091317
# Run a final processing of arguments
13101318
process_arguments
13111319
}
13121320

13131321
# Function: Process and execute actions based on parsed arguments
13141322
process_arguments() {
1323+
# App specific configuration and parsing
13151324
[[ "$LIST_CONNECTIONS" = true || "$HISTORY" = true ]] && list_connection_states
1316-
[[ "$EDIT_CONFIG_FILE" = true ]] && edit_file "$CONFIG_FILE"
1317-
[[ "$SHOW_LOG" = true ]] && show_log
1318-
[[ "$SHOW_CONFIG_FILE" = true ]] && show_config_file
1325+
1326+
# Keep this last so we show the final configuration state
13191327
[[ "$SHOW_CONFIG" = true ]] && show_config && show_version && exit
13201328
}
13211329

@@ -1945,7 +1953,7 @@ main() {
19451953

19461954
log_message "DEBUG" "Current timestamp: $current_timestamp" "$LINENO"
19471955

1948-
# Main application function calls
1956+
# Start of main application function calls
19491957

19501958
# Get the connection groups
19511959
local groups=($(get_connection_groups "$CONFIG_FILE"))
@@ -1968,6 +1976,8 @@ main() {
19681976
done
19691977
done
19701978

1979+
# End of main application function calls
1980+
19711981
# Increment the repeat counter
19721982
repeat_count=$((repeat_count + 1))
19731983
log_message "DEBUG" "Iteration: $repeat_count" "$LINENO"

noircon.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH NOIRCON 1 "December 17, 2024" "NoirCon 1.0.0" "User Commands"
1+
.TH NOIRCON 1 "December 17, 2024" "NoirCon 1.0.1" "User Commands"
22
.SH NAME
33
NoirCon \- Monitors addresses to check their availability and sends notifications.
44
.SH SYNOPSIS

0 commit comments

Comments
 (0)