Root/package/base-files/files/etc/init.d/network

1#!/bin/sh /etc/rc.common
2# Copyright (C) 2006 OpenWrt.org
3
4START=40
5STOP=90
6
7boot() {
8    setup_switch() { return 0; }
9
10    include /lib/network
11    setup_switch
12    grep -qs config /etc/config/wireless && {
13        /sbin/wifi up
14    } || {
15        rm -f /etc/config/wireless
16        /sbin/wifi detect > /etc/config/wireless
17    }
18
19    scan_interfaces
20
21    local ifc
22    for ifc in $interfaces; do
23        local proto
24        config_get proto "$ifc" proto
25
26        local auto
27        config_get_bool auto "$ifc" auto 1
28
29        type "coldplug_interface_$proto" >/dev/null && [ "$auto" = 1 ] && \
30            coldplug_interface_$proto "$ifc"
31    done
32}
33
34start() {
35    setup_switch() { return 0; }
36    
37    include /lib/network
38    setup_switch
39    ifup -a
40    /sbin/wifi up
41}
42
43stop() {
44    ifdown -a
45}
46
47restart() {
48    start
49}
50

Archive Download this file



interactive