Skip to content

Commit

Permalink
gluon-upgrade-special: activate any mesh interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Jörg Deckert committed Jul 30, 2016
1 parent 90b0ec3 commit b0ac14a
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
38 changes: 38 additions & 0 deletions gluon-upgrade-special/Makefile
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 gluon-upgrade-special/files/lib/gluon/upgrade/599-mesh-activate
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')

0 comments on commit b0ac14a

Please sign in to comment.