[packages] skels: use network.sh to find device names
git-svn-id: svn://svn.openwrt.org/openwrt/packages@31973 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
bb93516488
commit
c623289c18
@ -1,17 +1,16 @@
|
|||||||
#!/bin/sh /etc/rc.common
|
#!/bin/sh /etc/rc.common
|
||||||
# Sample init script reading its
|
# Sample init script reading its
|
||||||
# configuration from /etc/config/package
|
# configuration from /etc/config/package
|
||||||
|
|
||||||
START=46
|
START=46
|
||||||
STOP=46
|
STOP=46
|
||||||
|
|
||||||
start_service() {
|
start_service() {
|
||||||
local section="$1"
|
local section="$1"
|
||||||
|
|
||||||
include /lib/network
|
|
||||||
scan_interfaces
|
|
||||||
config_load /var/state/network
|
|
||||||
|
|
||||||
config_get LAN lan ifname
|
. /lib/functions/network.sh
|
||||||
|
|
||||||
|
network_get_device LAN lan ifname
|
||||||
config_get option1 "$section" option1
|
config_get option1 "$section" option1
|
||||||
config_get option2 "$section" option2
|
config_get option2 "$section" option2
|
||||||
|
|
||||||
@ -21,12 +20,10 @@ start_service() {
|
|||||||
|
|
||||||
stop_service() {
|
stop_service() {
|
||||||
local section="$1"
|
local section="$1"
|
||||||
|
|
||||||
include /lib/network
|
|
||||||
scan_interfaces
|
|
||||||
config_load /var/state/network
|
|
||||||
|
|
||||||
config_get LAN lan ifname
|
. /lib/functions/network.sh
|
||||||
|
|
||||||
|
network_get_device LAN lan ifname
|
||||||
config_get option1 "$section" option1
|
config_get option1 "$section" option1
|
||||||
config_get option2 "$section" option2
|
config_get option2 "$section" option2
|
||||||
}
|
}
|
||||||
@ -37,7 +34,7 @@ start() {
|
|||||||
config_foreach start_service package
|
config_foreach start_service package
|
||||||
}
|
}
|
||||||
|
|
||||||
stop () {
|
stop() {
|
||||||
config_load "package"
|
config_load "package"
|
||||||
config_foreach stop_service package
|
config_foreach stop_service package
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user