Skip to content
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

[fix] Simplified compiling package without iwinfo #144

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions openwisp-monitoring/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ define Package/netjson-monitoring/install
files/lib/openwisp-monitoring/wifi.lua \
$(1)/usr/lib/lua/openwisp-monitoring/wifi.lua

# Iwinfo is enabled by default unless specified otherwise
$(INSTALL_DIR) $(1)/usr/lib/lua/openwisp-monitoring
sed 's/true/$(if $(CONFIG_NETJSON_MONITORING_IWINFO),true,false)/' \
files/lib/openwisp-monitoring/iwinfo.lua > $(1)/usr/lib/lua/openwisp-monitoring/iwinfo.lua
# Iwinfo is enabled by default unless specified otherwise
ifeq ($(CONFIG_NETJSON_MONITORING_IWINFO), y)
$(CP) files/lib/openwisp-monitoring/iwinfo.lua $(1)/usr/lib/lua/openwisp-monitoring/iwinfo.lua
endif

$(CP) ../VERSION $(1)/usr/lib/openwisp-monitoring/
endef
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ monitoring.neighbors = require('openwisp-monitoring.neighbors')
monitoring.resources = require('openwisp-monitoring.resources')
monitoring.utils = require('openwisp-monitoring.utils')
monitoring.wifi = require('openwisp-monitoring.wifi')
monitoring.iwinfo = require('openwisp-monitoring.iwinfo')

local success, iwinfo = pcall(require, 'openwisp-monitoring.iwinfo')
if success then
monitoring.iwinfo = iwinfo
else
monitoring.iwinfo = {
enabled = false
}
end

return monitoring