* applications/luci-splash: Removed dependency to sgi-haserl, Updated attributes
This commit is contained in:
parent
aeb411d19d
commit
92a919d8ee
6 changed files with 9 additions and 13 deletions
0
applications/luci-splash/root/etc/cron.minutely/luci_splash
Normal file → Executable file
0
applications/luci-splash/root/etc/cron.minutely/luci_splash
Normal file → Executable file
0
applications/luci-splash/root/etc/init.d/luci_splash
Normal file → Executable file
0
applications/luci-splash/root/etc/init.d/luci_splash
Normal file → Executable file
15
applications/luci-splash/root/usr/lib/luci-splash/htdocs/cgi-bin/index.cgi
Normal file → Executable file
15
applications/luci-splash/root/usr/lib/luci-splash/htdocs/cgi-bin/index.cgi
Normal file → Executable file
|
@ -1,6 +1,5 @@
|
||||||
#!/usr/bin/haserl --shell=luac
|
#!/usr/bin/lua
|
||||||
|
|
||||||
require("luci.http")
|
|
||||||
require("luci.sys")
|
require("luci.sys")
|
||||||
require("luci.model.uci")
|
require("luci.model.uci")
|
||||||
|
|
||||||
|
@ -8,7 +7,7 @@ luci.model.uci.set_savedir(luci.model.uci.savedir_state)
|
||||||
|
|
||||||
local srv
|
local srv
|
||||||
local net
|
local net
|
||||||
local ip = luci.http.env.REMOTE_ADDR
|
local ip = os.getenv("REMOTE_ADDR")
|
||||||
luci.model.uci.foreach("network", "interface",
|
luci.model.uci.foreach("network", "interface",
|
||||||
function (section)
|
function (section)
|
||||||
if section.ipaddr then
|
if section.ipaddr then
|
||||||
|
@ -30,10 +29,11 @@ luci.model.uci.foreach("luci_splash", "iface",
|
||||||
end)
|
end)
|
||||||
|
|
||||||
if not srv then
|
if not srv then
|
||||||
luci.http.prepare_content("text/plain")
|
print("Content-Type: text/plain\n")
|
||||||
print("Unable to detect network settings!")
|
print("Unable to detect network settings!")
|
||||||
elseif not stat then
|
elseif not stat then
|
||||||
luci.http.redirect("http://" .. srv)
|
print("Status: 302 Found")
|
||||||
|
print("Location: http://" .. srv)
|
||||||
else
|
else
|
||||||
local action = "splash"
|
local action = "splash"
|
||||||
|
|
||||||
|
@ -48,5 +48,6 @@ else
|
||||||
action = "allowed"
|
action = "allowed"
|
||||||
end
|
end
|
||||||
|
|
||||||
luci.http.redirect("http://" .. srv .. "/cgi-bin/luci-splash/" .. action)
|
print("Status: 302 Found")
|
||||||
end
|
print("Location: http://" .. srv .. "/cgi-bin/luci-splash/" .. action)
|
||||||
|
end
|
||||||
|
|
0
applications/luci-splash/root/usr/sbin/luci-splash
Normal file → Executable file
0
applications/luci-splash/root/usr/sbin/luci-splash
Normal file → Executable file
0
applications/luci-splash/root/www/cgi-bin/luci-splash
Normal file → Executable file
0
applications/luci-splash/root/www/cgi-bin/luci-splash
Normal file → Executable file
|
@ -282,7 +282,7 @@ endef
|
||||||
|
|
||||||
define Package/luci-app-splash
|
define Package/luci-app-splash
|
||||||
$(call Package/luci/fftemplate)
|
$(call Package/luci/fftemplate)
|
||||||
DEPENDS+=+luci-sgi-haserl +iptables-mod-nat +iptables-mod-ipopt
|
DEPENDS+=+iptables-mod-nat +iptables-mod-ipopt
|
||||||
TITLE:=Freifunk DHCP-Splash application
|
TITLE:=Freifunk DHCP-Splash application
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
@ -292,11 +292,6 @@ endef
|
||||||
|
|
||||||
define Package/luci-app-splash/install
|
define Package/luci-app-splash/install
|
||||||
$(call Package/luci/install/template,$(1),applications/luci-splash)
|
$(call Package/luci/install/template,$(1),applications/luci-splash)
|
||||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-splash/dist/usr/sbin/luci-splash $(1)/usr/sbin
|
|
||||||
$(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
|
endef
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue