-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gluon-upgrade-special: activate any mesh interface
- Loading branch information
Jörg Deckert
committed
Jul 30, 2016
1 parent
90b0ec3
commit b0ac14a
Showing
2 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Copyright (C) 2016 Jörg Deckert <joergd at bitquell.de> | ||
# This is free software, licensed under the Apache 2.0 license. | ||
|
||
include $(TOPDIR)/rules.mk | ||
|
||
PKG_NAME:=gluon-upgrade-special | ||
PKG_VERSION:=1 | ||
|
||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) | ||
|
||
include $(GLUONDIR)/include/package.mk | ||
|
||
define Package/gluon-upgrade-special | ||
SECTION:=gluon | ||
CATEGORY:=Gluon | ||
TITLE:=Upgrade special | ||
DEPENDS:=+gluon-core | ||
endef | ||
|
||
define Package/gluon-upgrade-special/description | ||
Do special things during upgrades. | ||
endef | ||
|
||
define Build/Prepare | ||
mkdir -p $(PKG_BUILD_DIR) | ||
endef | ||
|
||
define Build/Configure | ||
endef | ||
|
||
define Build/Compile | ||
endef | ||
|
||
define Package/gluon-upgrade-special/install | ||
$(CP) ./files/* $(1)/ | ||
endef | ||
|
||
$(eval $(call BuildPackage,gluon-upgrade-special)) |
20 changes: 20 additions & 0 deletions
20
gluon-upgrade-special/files/lib/gluon/upgrade/599-mesh-activate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/lua | ||
|
||
local site = require 'gluon.site_config' | ||
local uci = require 'luci.model.uci'.cursor() | ||
|
||
local radios = {} | ||
|
||
-- look for wifi interfaces and add them to the array | ||
uci:foreach('wireless', 'wifi-device', | ||
function(s) | ||
table.insert(radios, s['.name']) | ||
end | ||
) | ||
|
||
for _, radio in ipairs(radios) do | ||
uci:set('wireless', 'mesh_' .. radio, "disabled", 0) | ||
end | ||
|
||
uci:save('wireless') | ||
uci:commit('wireless') |