From 83167e31fe63265a7004a748f88de271da28a690 Mon Sep 17 00:00:00 2001 From: Wouter R Date: Mon, 17 Jun 2013 20:23:00 +0200 Subject: [PATCH] Minor changes (fix ap mode, be more informative about failed rename); update TODO. --- TODO | 4 ++++ src/autowifi/reconf.lua | 11 ++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/TODO b/TODO index 33206fa..84d815e 100644 --- a/TODO +++ b/TODO @@ -1,9 +1,13 @@ # TODO +- licensing (also for hardware and firmware) + credits + http://www.codinghorror.com/blog/2007/04/pick-a-license-any-license.html - add more config options to package; candidates: reconf.WWW_RENAME_NAME, wifihelper.{AP_ADDRESS, AP_NETMASK, (NET)} about bridging this to lua: have some Makefile stage create a ini/lua file with k/v's and have lua read out that file? + https://github.com/2ion/ini.lua - write a shellscript to automate tasks like swapping out /www and packaging modified code for git merging - see if updating works when a new version is 'released' (probably needs a real feed) +- perhaps opkg+safeboot could be useful in the update mechanism? - add aliases to root profile only when debugging was requested in menuconfig - add config option to compile sources using luac? - add dependency on either wr703n or mr3020 (and probably comment it out to avoid being to conservative...) diff --git a/src/autowifi/reconf.lua b/src/autowifi/reconf.lua index 86406e2..550eb17 100644 --- a/src/autowifi/reconf.lua +++ b/src/autowifi/reconf.lua @@ -125,11 +125,11 @@ end function reconf.staticaddr_add(dirtyList) uci:set("network", wifi.NET, "interface") --TODO: remove ifname on wlan interface? + --NOTE: 'type = "bridge"' should -not- be added as this prevents defining a separate dhcp pool (http://wiki.openwrt.org/doc/recipes/routedap) M.uciTableSet("network", wifi.NET, { proto = "static", ipaddr = wifi.AP_ADDRESS, - netmask = wifi.AP_NETMASK, - type = "bridge", + netmask = wifi.AP_NETMASK }) bothBits(dirtyList, "network") end @@ -139,7 +139,7 @@ function reconf.staticaddr_rm(dirtyList) uci:set("network", wifi.NET, "proto", "dhcp") uci:delete("network", wifi.NET, "ipaddr") uci:delete("network", wifi.NET, "netmask") - uci:delete("network", wifi.NET, "type") + --uci:delete("network", wifi.NET, "type") --do not remove since it is not added anymore bothBits(dirtyList, "network") end @@ -198,11 +198,12 @@ function reconf.wwwcaptive_add(dirtyList) if u.exists(M.WWW_CAPTIVE_INDICATOR) then return u:logdebug("WWW captive directory already in place, not redoing", false) end - if os.rename("/www", M.WWW_RENAME_NAME) == true then + local rv,reason = os.rename("/www", M.WWW_RENAME_NAME) + if rv == true then u.symlink(M.WWW_CAPTIVE_PATH, "/www") return true else - return u:logerror("Could not rename /www to " .. M.WWW_RENAME_NAME) + return u:logerror("Could not rename /www to " .. M.WWW_RENAME_NAME .. "(" .. reason .. ")") end end function reconf.wwwcaptive_rm(dirtyList)