Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

close pivasoftware/easycwmp#3 #4

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ext/openwrt/config/easycwmp
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,7 @@ config scripts
list function lan_device
list location /usr/share/easycwmp/functions/management_server
list function management_server
list location /usr/share/easycwmp/functions/user
list function user
list location /usr/share/easycwmp/functions/wan_device
list function wan_device
23 changes: 19 additions & 4 deletions ext/openwrt/init.d/easycwmpd
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,29 @@

START=90

change_config() {
local iface=`uci get easycwmp.@local[0].interface`
if [ "$iface" = "eth0" ]; then
. /lib/functions/network.sh; network_get_device if_wan wan;
if [ "$if_wan" = "$iface" ]; then
return 0
fi
uci set easycwmp.@local[0].interface="$if_wan"
uci commit easycwmp
fi
return 0
}

boot() {
service_start /usr/sbin/easycwmpd --boot
change_config
service_start /usr/sbin/easycwmpd --boot
}

start() {
service_start /usr/sbin/easycwmpd --getrpcmethod
change_config
service_start /usr/sbin/easycwmpd --getrpcmethod
}

stop() {
service_stop /usr/sbin/easycwmpd
}
service_stop /usr/sbin/easycwmpd
}
Loading