Commit 1e3452a3 authored by chenhaowen's avatar chenhaowen

add: luci option of enable crypt

parent 32b878c0
...@@ -3,4 +3,5 @@ config gdut_drcom ...@@ -3,4 +3,5 @@ config gdut_drcom
option remote_ip '10.0.3.2' option remote_ip '10.0.3.2'
option keep_alive1_flag '2a' option keep_alive1_flag '2a'
option enable '1' option enable '1'
option enable_crypt '0'
...@@ -7,11 +7,12 @@ start() { ...@@ -7,11 +7,12 @@ start() {
keep_alive1_flag=$(uci get gdut_drcom.@gdut_drcom[0].keep_alive1_flag 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=$(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) # 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) # ifname=$(uci get gdut_drcom.@gdut_drcom[0].ifname 2>/dev/null)
username=$(uci get gdut_drcom.@gdut_drcom[0].username 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) # password=$(uci get gdut_drcom.@gdut_drcom[0].password 2>/dev/null)
macaddr=$(uci get gdut_drcom.@gdut_drcom[0].macaddr 2>/dev/null) macaddr=$(uci get gdut_drcom.@gdut_drcom[0].macaddr 2>/dev/null)
enable_crypt=$(uci get gdut_drcom.@gdut_drcom[0].enable_crypt 2>/dev/null)
if [ "$enable"x = "1"x ]; then if [ "$enable"x = "1"x ]; then
...@@ -44,6 +45,9 @@ start() { ...@@ -44,6 +45,9 @@ start() {
fi fi
if [ -n "$keep_alive1_flag" ]; then if [ -n "$keep_alive1_flag" ]; then
cmd=$cmd"--keep-alive1-flag=$keep_alive1_flag " cmd=$cmd"--keep-alive1-flag=$keep_alive1_flag "
fi
if [ "$enable_crypt"x = "1"x ]; then
cmd=$cmd"--enable-crypt "
fi fi
cmd=$cmd"1> /tmp/gdut-drcom.log 2>/tmp/gdut-drcom_error.log &" cmd=$cmd"1> /tmp/gdut-drcom.log 2>/tmp/gdut-drcom_error.log &"
......
...@@ -42,6 +42,7 @@ macaddr.datatype="macaddr" ...@@ -42,6 +42,7 @@ macaddr.datatype="macaddr"
remote_ip = s:option(Value, "remote_ip", translate("Remote ip")) remote_ip = s:option(Value, "remote_ip", translate("Remote ip"))
remote_ip.datatype="ipaddr" remote_ip.datatype="ipaddr"
keep_alive_flag = s:option(Value, "keep_alive1_flag", translate("Keep alive1 flag")) keep_alive_flag = s:option(Value, "keep_alive1_flag", translate("Keep alive1 flag"))
enable_crypt = s:option(Flag, "enable_crypt", translate("Enable crypt"))
local apply = luci.http.formvalue("cbi.apply") local apply = luci.http.formvalue("cbi.apply")
if apply then if apply then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment