Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
G
gdut-drcom
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
gdut-drcom
Commits
4d4bb0b1
Commit
4d4bb0b1
authored
Oct 08, 2016
by
chenhaowen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add luci macaddr option
parent
b7b15a79
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
3 deletions
+49
-3
src/root/etc/config/gdut_drcom
src/root/etc/config/gdut_drcom
+1
-1
src/root/etc/init.d/gdut-drcom
src/root/etc/init.d/gdut-drcom
+27
-2
src/root/usr/lib/lua/luci/model/cbi/gdut-drcom.lua
src/root/usr/lib/lua/luci/model/cbi/gdut-drcom.lua
+21
-0
No files found.
src/root/etc/config/gdut_drcom
View file @
4d4bb0b1
config gdut_drcom
option remote_ip '
0.0.0.0
'
option remote_ip '
10.0.3.2
'
option keep_alive1_flag '2a'
option enable '1'
src/root/etc/init.d/gdut-drcom
View file @
4d4bb0b1
...
...
@@ -6,6 +6,14 @@ start() {
remote_ip
=
$(
uci get gdut_drcom.@gdut_drcom[0].remote_ip 2>/dev/null
)
keep_alive1_flag
=
$(
uci get gdut_drcom.@gdut_drcom[0].keep_alive1_flag 2>/dev/null
)
enable
=
$(
uci get gdut_drcom.@gdut_drcom[0].enable 2>/dev/null
)
enable_dial
=
$(
uci get gdut_drcom.@gdut_drcom[0].enable_dial 2>/dev/null
)
ifname
=
$(
uci get gdut_drcom.@gdut_drcom[0].ifname 2>/dev/null
)
username
=
$(
uci get gdut_drcom.@gdut_drcom[0].username 2>/dev/null
)
password
=
$(
uci get gdut_drcom.@gdut_drcom[0].password 2>/dev/null
)
macaddr
=
$(
uci get gdut_drcom.@gdut_drcom[0].macaddr 2>/dev/null
)
if
[
"
$enable
"
x
=
"1"
x
]
;
then
/etc/init.d/gdut-drcom
enable
else
...
...
@@ -13,12 +21,29 @@ start() {
return
fi
# if [ "$enable_dial"x = "1"x ]; then
# uci set network.wan.ifname="$ifname"
# uci set network.wan.proto="pppoe"
# uci set network.wan.username="$username"
# uci set network.wan.password="$password"
# uci set network.wan._orig_ifname='eth0.2'
# uci set network.wan._orig_bridge='false'
# uci commit
# /etc/init.d/network restart
# fi
if
[
-n
"
$macaddr
"
]
;
then
uci
set
network.wan.macaddr
=
"
$macaddr
"
uci commit
# /etc/init.d/network restart
fi
cmd
=
"service_start /usr/bin/gdut-drcom -c /etc/gdut-drcom.conf "
if
[
-n
"
$remote_ip
"
]
;
then
cmd
=
$cmd
"--remote
-
ip=
$remote_ip
"
cmd
=
$cmd
"--remote
_
ip=
$remote_ip
"
fi
if
[
-n
"
$keep_alive1_flag
"
]
;
then
cmd
=
$cmd
"--keep
-alive1-
flag=
$keep_alive1_flag
"
cmd
=
$cmd
"--keep
_alive1_
flag=
$keep_alive1_flag
"
fi
cmd
=
$cmd
"1> /tmp/gdut-drcom.log 2>/tmp/gdut-drcom_error.log &"
...
...
src/root/usr/lib/lua/luci/model/cbi/gdut-drcom.lua
View file @
4d4bb0b1
...
...
@@ -19,7 +19,28 @@ s.addremove = false
s
.
anonymous
=
true
enable
=
s
:
option
(
Flag
,
"enable"
,
translate
(
"Enable"
))
--[[enabledial = s:option(Flag, "enabledial", translate("Enable PPPoE Dial"))
enabledial.default = enabledial.enabled
ifname = s:option(ListValue, "ifname", translate("Interface name"))
ifname:depends("enabledial", "1")
for k, v in ipairs(luci.sys.net.devices()) do
if string.sub(v,0,3) == "eth" then
ifname:value(v)
end
end
username = s:option(Value, "username", translate("Username"))
username:depends("enabledial", "1")
password = s:option(Value, "password", translate("Password"))
password:depends("enabledial", "1")
password.password = true
]]
--
macaddr
=
s
:
option
(
Value
,
"macaddr"
,
translate
(
"Mac address"
))
macaddr
.
datatype
=
"macaddr"
remote_ip
=
s
:
option
(
Value
,
"remote_ip"
,
translate
(
"Remote ip"
))
remote_ip
.
datatype
=
"ipaddr"
keep_alive_flag
=
s
:
option
(
Value
,
"keep_alive1_flag"
,
translate
(
"Keep alive1 flag"
))
local
apply
=
luci
.
http
.
formvalue
(
"cbi.apply"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment