5 [ -f /etc/conf.d/dhcpcd ] && . /etc/conf.d/dhcpcd
10 + nwm_confdir="/etc/networkmod/$1"
11 + if [ -d "$nwm_confdir" ]; then
12 + find "$nwm_confdir" -type f -executable -exec {} "$2" \;
18 if [ "$1" = "" ]; then
23 + run_hooks pre-ifup "$ifname"
25 /sbin/ifconfig $ifname up
33 + run_hooks post-ifup "$ifname"
39 eval iwcfg="\$wlan_${1}"
40 [ "$iwcfg" = "" ] && return 0
42 + run_hooks pre-wi_up "$1"
44 /usr/sbin/iwconfig $iwcfg
45 [[ -z "$WIRELESS_TIMEOUT" ]] && WIRELESS_TIMEOUT=2
46 sleep $WIRELESS_TIMEOUT
48 printhl "Could not associate $1 - try increasing WIRELESS_TIMEOUT and check network is WEP or has no security"
52 + run_hooks post-wi_up "$1"
58 /bin/kill $(cat /var/run/dhcpcd-${1}.pid)
63 + run_hooks pre-ifdown "$1"
65 # Always bring the interface itself down
66 /sbin/ifconfig ${1} down >/dev/null 2>&1
68 + run_hooks post-ifdown "$1"
76 eval routecfg="\$${1}"
78 + run_hooks pre-rtup "$1"
80 if grep -q :: <<< $routecfg; then
81 /sbin/route -A inet6 add $routecfg
83 /sbin/route add $routecfg
86 + run_hooks post-rtup "$1"
94 eval routecfg="\$${1}"
96 + run_hooks pre-rtdown "$1"
98 if grep -q :: <<< $routecfg; then
99 /sbin/route -A inet6 del $routecfg
101 /sbin/route del $routecfg
104 + run_hooks post-rtdown "$1"
113 + run_hooks pre-bond_up ""
114 for ifline in ${BOND_INTERFACES[@]}; do
115 if [ "$ifline" = "${ifline#!}" ]; then
116 eval bondcfg="\$bond_${ifline}"
117 @@ -144,20 +183,24 @@
121 + run_hooks post-bond_up ""
126 + run_hooks pre-bond_down ""
127 for ifline in ${BOND_INTERFACES[@]}; do
128 if [ "$ifline" = "${ifline#!}" ]; then
129 eval bondcfg="\$bond_${ifline}"
130 /sbin/ifenslave -d $ifline $bondcfg || error=1
133 + run_hooks post-bond_down ""
138 + run_hooks pre-bridge_up ""
139 for br in ${BRIDGE_INTERFACES[@]}; do
140 if [ "$br" = "${br#!}" ]; then
141 # if the bridge already exists, remove it
142 @@ -183,26 +226,29 @@
146 + run_hooks post-bridge_up ""
151 + run_hooks pre-bridge_down ""
152 for br in ${BRIDGE_INTERFACES[@]}; do
153 if [ "$br" = "${br#!}" ]; then
154 /usr/sbin/brctl delbr $br
157 + run_hooks post-bridge_down ""
163 - if ! ck_daemon network; then
164 - echo "Network is already running. Try 'network restart'"
165 + if ! ck_daemon networkmod; then
166 + echo "Networkmod is already running. Try 'networkmod restart'"
170 - stat_busy "Starting Network"
171 + stat_busy "Starting Networkmod"
173 # bring up bridge interfaces
175 @@ -221,25 +267,25 @@
178 if [ $error -eq 0 ]; then
180 + add_daemon networkmod
187 - #if ck_daemon network; then
188 - # echo "Network is not running. Try 'network start'"
189 + #if ck_daemon networkmod; then
190 + # echo "Networkmod is not running. Try 'networkmod start'"
194 if [ "${NETWORK_PERSIST}" = "yes" -o "${NETWORK_PERSIST}" = "YES" ]; then
195 - status "Skipping Network Shutdown" true
196 + status "Skipping Networkmod Shutdown" true
200 - stat_busy "Stopping Network"
202 + stat_busy "Stopping Networkmod"
203 + rm_daemon networkmod
205 for rtline in "${ROUTES[@]}"; do
206 if [ "$rtline" = "${rtline#!}" ]; then
211 - echo "usage: $0 {start|stop|restart}"
212 + echo "usage: $0 {start|stop|restart}"
213 echo " $0 {ifup|ifdown|iflist|rtup|rtdown|rtlist}"