66
77# App version and name
88APP_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)
4747TIMEOUT=" 5s"
4848
49+ # Default check repeat (0=infinite)
50+ REPEAT=0
51+
4952# Pushover notification options
5053PUSHOVER_NOTIFICATION=false
5154PUSHOVER_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
13141322process_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 "
0 commit comments