-
Notifications
You must be signed in to change notification settings - Fork 20
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
[refactor] Refactored agent with main and help function #33 #47
Conversation
e89e46f
to
f43081b
Compare
ee7a0e9
to
f9f54b3
Compare
e758837
to
7dcbb87
Compare
f9f54b3
to
af7461a
Compare
af7461a
to
c3cb815
Compare
f7bfff9
to
6364369
Compare
Converting this to draft as it will result in merge conflicts with #53 |
2f4e478
to
ecbcb80
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@feckert WDYT?
@@ -69,7 +69,6 @@ start_service() { | |||
exit 1 | |||
fi | |||
interval="--interval $interval" | |||
monitored_interfaces="--monitored_interfaces \"$monitored_interfaces\"" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was left by mistake. Removed now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
f612003
to
0809e27
Compare
printf " --uuid <uuid>\t\t\t\t: UUID of the device.\n" | ||
printf " --key <key>\t\t\t\t: Key for the device.\n" | ||
printf " --verify_ssl <0, 1>\t\t\t: Whether SSL Authentication should be enabled or not.\n" | ||
printf "Openwisp Monitoring config options:\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Openwisp > OpenWISP here and above
@@ -69,7 +69,6 @@ start_service() { | |||
exit 1 | |||
fi | |||
interval="--interval $interval" | |||
monitored_interfaces="--monitored_interfaces \"$monitored_interfaces\"" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
0809e27
to
d64895b
Compare
exit 0 | ||
} | ||
|
||
show_version() { | ||
VERSION=$(cat /etc/openwisp/monitoring/VERSION) | ||
echo "openwisp-monitoring $VERSION" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could use here
echo "$(basename "$0") $VERSION)" so we have always the real name of the file
|
||
INTERVAL=${INTERVAL:-300} | ||
VERBOSE_MODE=${VERBOSE_MODE:-0} | ||
TMP_DIR="/tmp/openwisp/monitoring" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we not create this dir with mkdir -p
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am doing in save_data function
openwrt-openwisp-monitoring/openwrt-openwisp-monitoring/files/monitoring.agent
Lines 128 to 129 in 7be1724
# make directory | |
mkdir -p "$TMP_DIR" |
Closes #33