* DHCP-Splash fixes #1

This commit is contained in:
Steven Barth 2008-05-11 10:29:45 +00:00
parent cce73ddb4d
commit 045d9c1942
7 changed files with 19 additions and 20 deletions

View file

@ -29,24 +29,22 @@ end
if not srv then
ffluci.http.prepare_content("text/plain")
return print("Unable to detect network settings!")
end
if not stat then
print("Unable to detect network settings!")
elseif not stat then
ffluci.http.redirect("http://" .. srv)
end
local action = "splash"
local mac = ffluci.sys.net.ip4mac(ip)
if not mac then
action = "unknown"
end
local status = ffluci.sys.execl("luci-splash status "..mac)[1]
if status == "whitelisted" or status == "lease" then
action = "allowed"
end
ffluci.http.redirect("http://" .. srv .. "/cgi-bin/luci-splash/" .. action)
else
local action = "splash"
local mac = ffluci.sys.net.ip4mac(ip)
if not mac then
action = "unknown"
end
local status = ffluci.sys.execl("luci-splash status "..mac)[1]
if status == "whitelisted" or status == "lease" then
action = "allowed"
end
ffluci.http.redirect("http://" .. srv .. "/cgi-bin/luci-splash/" .. action)
end

View file

@ -156,6 +156,7 @@ define Package/ffluci-app-splash/install
$(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-splash/dist/etc/init.d/luci_splash $(1)/etc/init.d
$(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-splash/dist/etc/cron.minutely/luci_splash $(1)/etc/cron.minutely
$(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-splash/dist/usr/lib/luci-splash/htdocs/cgi-bin/index.cgi $(1)/usr/lib/luci-splash/htdocs/cgi-bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-splash/dist/www/cgi-bin/luci-splash $(1)/www/cgi-bin/luci-splash
endef