Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add luci web control support for njit8021xclient
- Loading branch information
Showing
13 changed files
with
152 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
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,4 @@ | ||
PO = njit | ||
|
||
include ../../build/config.mk | ||
include ../../build/module.mk |
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 @@ | ||
/etc/njit.conf |
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,9 @@ | ||
#!/bin/sh | ||
|
||
[ -n "${IPKG_INSTROOT}" ] || { | ||
( . /etc/uci-defaults/luci-njit ) && rm -f /etc/uci-defaults/luci-njit | ||
chmod 755 /etc/init.d/njit >/dev/null 2>&1 | ||
/etc/init.d/njit enable >/dev/null 2>&1 | ||
|
||
exit 0 | ||
} |
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,5 @@ | ||
#!/bin/sh | ||
uci delete ucitrack.@njit[-1] >/dev/null 2>&1 | ||
uci commit ucitrack | ||
|
||
exit 0 |
19 changes: 19 additions & 0 deletions
19
feeds/luci/luci/luci/applications/luci-njit/luasrc/controller/njit.lua
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,19 @@ | ||
--[[ | ||
LuCI njit | ||
Author:ferstar | ||
Email:zhangjianfei3@gmail.com | ||
]]-- | ||
|
||
module("luci.controller.njit", package.seeall) | ||
|
||
function index() | ||
|
||
if nixio.fs.access("/etc/config/njit") then | ||
local page | ||
page = entry({"admin", "services", "njit"}, cbi("njit"), _("NJIT-CLIENT")) | ||
page.i18n = "njit" | ||
page.dependent = true | ||
end | ||
end |
29 changes: 29 additions & 0 deletions
29
feeds/luci/luci/luci/applications/luci-njit/luasrc/model/cbi/njit.lua
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,29 @@ | ||
--[[ | ||
LuCI njit | ||
#Author:ferstar | ||
#Email:zhangjianfei3@gmail.com | ||
]]-- | ||
|
||
require("luci.tools.webadmin") | ||
|
||
m = Map("njit", translate("njit"), translate("A H3C supplicant on Linux")) | ||
|
||
s = m:section(TypedSection, "njit", translate("Config njit"),translate("The options below are all of njit's arguments.")) | ||
s.anonymous = true | ||
|
||
s:option(Value, "Username", translate("Username")).default="xxx" | ||
|
||
pw=s:option(Value, "Password", translate("Password")) | ||
pw.password = true | ||
pw.rmempty = false | ||
pw.default= "***" | ||
|
||
nic=s:option(ListValue, "Nic", translate("net card name"),translate("Please make sure you have chose the right net card.")) | ||
nic.anonymous = true | ||
for k, v in pairs(luci.sys.net.devices()) do | ||
nic:value(v) | ||
end | ||
|
||
return m |
14 changes: 14 additions & 0 deletions
14
feeds/luci/luci/luci/applications/luci-njit/root/etc/config/cron
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,14 @@ | ||
config 'task' | ||
option 'enabled' '1' | ||
option 'task_name' 'reloading' | ||
option 'task_Everyday' '1' | ||
option 'task_Monday' '0' | ||
option 'task_Tuesday' '0' | ||
option 'task_Wednesday' '0' | ||
option 'task_Thursday' '0' | ||
option 'task_Friday' '0' | ||
option 'task_Sartuday' '0' | ||
option 'task_Sunday' '0' | ||
option 'task_time' '6:45' | ||
option 'task_task' '/etc/init.d/njit restart' | ||
|
4 changes: 4 additions & 0 deletions
4
feeds/luci/luci/luci/applications/luci-njit/root/etc/config/njit
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,4 @@ | ||
config 'njit' | ||
option 'Nic' 'eth0.2' | ||
option 'Username' 'ferstar' | ||
option 'Password' '123456' |
21 changes: 21 additions & 0 deletions
21
feeds/luci/luci/luci/applications/luci-njit/root/etc/init.d/njit
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,21 @@ | ||
#!/bin/sh /etc/rc.common | ||
#Author:ferstar | ||
#Email:zhangjianfei3@gmail.com | ||
|
||
START=55 | ||
|
||
start() | ||
{ | ||
njit-client $(uci get njit.@njit[0].Username) $(uci get njit.@njit[0].Password) $(uci get njit.@njit[0].Nic) & | ||
} | ||
|
||
stop() | ||
{ | ||
killall njit-client | ||
} | ||
|
||
restart() | ||
{ | ||
stop | ||
start | ||
} |
11 changes: 11 additions & 0 deletions
11
feeds/luci/luci/luci/applications/luci-njit/root/etc/uci-defaults/luci-njit
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,11 @@ | ||
#!/bin/sh | ||
|
||
uci -q batch <<-EOF >/dev/null | ||
delete ucitrack.@njit[-1] | ||
add ucitrack njit | ||
set ucitrack.@njit[-1].init=njit | ||
commit ucitrack | ||
EOF | ||
|
||
rm -f /tmp/luci-indexcache | ||
exit 0 |
3 changes: 3 additions & 0 deletions
3
feeds/luci/luci/luci/applications/luci-njit/root/usr/bin/njit-RefreshIP
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,3 @@ | ||
#!/bin/sh | ||
killall udhcpc | ||
udhcpc -t 0 -i $(uci get njit.@njit[0].Nic) -b -p /var/run/dhcp-$(uci get njit.@njit[0].Nic).pid |
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,29 @@ | ||
msgid "" | ||
msgstr "Content-Type: text/plain; charset=UTF-8" | ||
|
||
msgid "njit" | ||
msgstr "西北大学H3C认证" | ||
|
||
msgid "A H3C supplicant on Linux" | ||
msgstr "一个用于linux h3c上网认证的前端程序 源码作者:liuqun 前端作者:ferstar" | ||
|
||
msgid "Config njit" | ||
msgstr "配置客户端" | ||
|
||
msgid "NJIT-CLIENT" | ||
msgstr "校园网认证" | ||
|
||
msgid "Password" | ||
msgstr "密码" | ||
|
||
msgid "The options below are all of njit's arguments." | ||
msgstr "填入下列要求信息后请点击保存应用,很快路由器即可完成拨号认证,以后路由器启动会自动拨号认证,无需人工干预" | ||
|
||
msgid "Username" | ||
msgstr "帐号/学号" | ||
|
||
msgid "net card name" | ||
msgstr "网卡名" | ||
|
||
msgid "Please make sure you have chose the right net card." | ||
msgstr "请确定您选择了正确的网卡,稳定版OP一般会是eth0.2,对应WAN口" |