Skip to content

Commit 80f1438

Browse files
author
John Smith III
committed
Changed
- Order of Pushover user key and api token Fixed - Help output not displaying proper timeout defaults - Missing details in man page
1 parent 83f9c01 commit 80f1438

File tree

4 files changed

+37
-22
lines changed

4 files changed

+37
-22
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
- none
11+
12+
## [1.2.1] - 2024-11-26
13+
1014
### Changed
1115

1216
- Order of Pushover user key and api token
1317

18+
### Fixed
19+
20+
- Help output not displaying proper timeout defaults
21+
- Missing details in man page
22+
1423
## [1.2.0] - 2024-11-26
1524

1625
### Added

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ Run the script with the desired options. Below are some examples:
281281

282282
## Configuration
283283

284-
NoirNet uses a configuration file to store default settings. The default location is `$HOME/.config/noirnet.conf`. You can initialize a configuration file with default settings using:
284+
NoirNet uses a configuration file to store default settings. The default location is `~/.config/noirnet.conf`. You can initialize a configuration file with default settings using:
285285

286286
```bash
287287
./noirnet --init
@@ -293,7 +293,7 @@ NoirNet uses a configuration file to store default settings. The default locatio
293293
# NoirNet Configuration File
294294
CACHE_DIR="/tmp/noirnet_cache"
295295
LOG_FILE="/tmp/noirnet_cache/noirnet.log"
296-
CONFIG_FILE="$HOME/.config/noirnet.conf"
296+
CONFIG_FILE="~/.config/noirnet.conf"
297297
CHECK_INTERVAL=5
298298
TIMEOUT=5
299299
SYSTEM_NAME="My System"

noirnet

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

77
# App version and name
88
APP_NAME="NoirNet"
9-
VERSION=1.2.0
9+
VERSION=1.2.1
1010
LAST_UPDATED="2024-11-26"
1111

12+
# TODO:
13+
# - Add more notification methods (email, slack, discord, etc.)
14+
1215
# ==============================
1316
# Application Specific Variables
1417
# ==============================
@@ -461,9 +464,9 @@ send_pushover_notification() {
461464
local response
462465

463466
if [ "$PUSHOVER_NOTIFICATION" = true ]; then
464-
log_message "DEBUG" " Processing Pushover notification: $website_url" "$LINENO"
465-
log_message "DEBUG" " Url: $website_url" "$LINENO"
466-
log_message "DEBUG" " Message: $message" "$LINENO"
467+
log_message "DEBUG" "- Processing Pushover notification: $website_url" "$LINENO"
468+
log_message "DEBUG" "- Url: $website_url" "$LINENO"
469+
log_message "DEBUG" "- Message: $message" "$LINENO"
467470

468471
# Check if PUSHOVER_API_TOKEN is set
469472
if [[ -z "$PUSHOVER_API_TOKEN" ]]; then
@@ -508,7 +511,7 @@ send_pushover_notification() {
508511
return 1
509512
fi
510513

511-
log_message "DEBUG" " Pushover notification sent successfully." "$LINENO"
514+
log_message "DEBUG" "- Pushover notification sent successfully." "$LINENO"
512515
return 0
513516
fi
514517
}
@@ -799,10 +802,10 @@ show_help() {
799802

800803
# Network Check Configuration
801804
printf "\nNetwork Check Configuration:\n"
802-
printf " -i, --interval <seconds> Set the interval between checks (default: %d seconds).\n" "${CHECK_INTERVAL:-5}"
803-
printf " -T, --timeout <seconds> Set the timeout for ping and DNS tests (default: %d seconds).\n" "${DNS_TEST_TIMEOUT:-5}"
804-
printf " -P, --ping-target <IP> Set a custom ping target (default: %s).\n" "${PING_TARGET:-8.8.8.8}"
805-
printf " -D, --dns-test-domain <domain> Set a custom DNS test domain (default: %s).\n" "${DNS_TEST_DOMAIN:-example.com}"
805+
printf " -i, --interval <seconds> Set the interval between checks (default: %d seconds).\n" "${CHECK_INTERVAL}"
806+
printf " -T, --timeout <seconds> Set the connection timeout for remote connections (default: %d seconds).\n" "${TIMEOUT}"
807+
printf " -P, --ping-target <IP> Set a custom ping target (default: %s).\n" "${PING_TARGET}"
808+
printf " -D, --dns-test-domain <domain> Set a custom DNS test domain (default: %s).\n" "${DNS_TEST_DOMAIN}"
806809

807810
# Process Management Functions
808811
printf "\nProcess Management:\n"

noirnet.1

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH NOIRNET 1 "November 26, 2024" "Version 1.2.0" "User Commands"
1+
.TH NOIRNET 1 "November 26, 2024" "Version 1.2.1" "User Commands"
22
.SH NAME
33
NoirNet \- Monitors internet and DNS access and sends notifications.
44

@@ -18,13 +18,13 @@ Display this help message.
1818
\fB\-V\fR, \fB\-\-version\fR
1919
Display the application version.
2020
.TP
21-
\fB\-c\fR, \fB\-\-config\fR \fI<config_file>\fR
22-
Specify a custom configuration file (default: noirnet.conf).
21+
.B \-c, \--config <config_file>
22+
Specify a custom configuration file (default: ~/.config/noirwatch.conf).
2323
.TP
24-
\fB\-I\fR, \fB\-\-init\fR
24+
.B \-I, \--init
2525
Initialize the configuration file.
2626
.TP
27-
\fB\-F\fR, \fB\-\-force\-init\fR
27+
.B \-F, \--force-init
2828
Force initialize the configuration file if one exists.
2929
.TP
3030
\fB\-s\fR, \fB\-\-show\-config\fR
@@ -37,7 +37,7 @@ Show the configuration file.
3737
Delete all cached files.
3838
.TP
3939
\fB\-k\fR, \fB\-\-cache\-dir\fR \fI<path>\fR
40-
Specify a custom cache directory (default: noirnet_cache).
40+
Specify a custom cache directory (default: /tmp/noirnet_cache/).
4141
.TP
4242
\fB\-n\fR, \fB\-\-system\-name\fR \fI<name>\fR
4343
Name of the system running the script (default: system hostname).
@@ -61,7 +61,7 @@ Enable verbose output.
6161
Log the log file to the screen.
6262
.TP
6363
\fB\-o\fR, \fB\-\-output\fR \fI<file>\fR
64-
Specify a custom log file location (default: noirnet.log).
64+
Specify a custom log file location (default: /tmp/noirnet_cache/noirnet.log).
6565
.TP
6666
\fB\-L\fR, \fB\-\-log\-level\fR \fI<level>\fR
6767
Set the log level (FATAL, ERROR, WARN, INFO, DEBUG).
@@ -109,13 +109,13 @@ Stop the service:
109109

110110
.SH FILES
111111
.TP
112-
.B noirnet.conf
112+
.B ~/.config/noirnet.conf
113113
Default configuration file.
114114
.TP
115-
.B noirnet_cache/
115+
.B /tmp/noirnet_cache/
116116
Directory for cached files.
117117
.TP
118-
.B noirnet.log
118+
.B /tmp/noirnet_cache/noirnet.log
119119
Default log file.
120120

121121
.SH AUTHOR
@@ -125,4 +125,7 @@ John Smith III
125125
MIT License
126126

127127
.SH SEE ALSO
128-
ping(8), nslookup(1), curl(1), sed(1), cat(1)
128+
.BR curl (1),
129+
.BR xmllint (1),
130+
.BR notify-send (1),
131+
.BR osascript (1)

0 commit comments

Comments
 (0)