-
-
Notifications
You must be signed in to change notification settings - Fork 68
[refactor] Move Logging from init.d to Agent
#229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 2 commits
c8a778a
bcb1dbe
18fbb4d
46325b5
6d1c03d
4beafe2
deb625f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -129,6 +129,10 @@ while [ -n "$1" ]; do | |
| export CHECKSUM_RETRY_DELAY="$2" | ||
| shift | ||
| ;; | ||
| --log-message) | ||
| log_message "$2" | ||
| exit 0 | ||
| ;; | ||
| -*) | ||
| echo "Invalid option: $1" | ||
| exit 1 | ||
|
|
@@ -971,3 +975,15 @@ while true; do | |
| # ignore SIGUSR1 signals again | ||
| trap "" USR1 | ||
| done | ||
|
|
||
| # Logging function | ||
| log_message() { | ||
| local level="$1" | ||
| local message="${2:-}" # Default to an empty string if the second argument is not provided | ||
|
||
|
|
||
| if [ -z "$message" ]; then | ||
|
||
| logger -t openwisp -p "$level" "No message provided" | ||
| else | ||
| logger -t openwisp -p "$level" "$message" | ||
| fi | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.