/[vps]/baselayout-vserver/trunk/net-scripts/net.modules.d/netplugd
Gentoo

Diff of /baselayout-vserver/trunk/net-scripts/net.modules.d/netplugd

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 251 Revision 252
27 27
28# bool netplugd_pre_start(char *interface) 28# bool netplugd_pre_start(char *interface)
29# 29#
30# Start netplug on an interface 30# Start netplug on an interface
31netplugd_pre_start() { 31netplugd_pre_start() {
32 local iface="$1" timeout i 32 local iface="$1" timeout
33 local pidfile="/var/run/netplugd.${iface}.pid" 33 local pidfile="/var/run/netplugd.${iface}.pid"
34 34
35 # We don't start netplug if we're being called from the background 35 # We don't start netplug if we're being called from the background
36 ${IN_BACKGROUND} && return 0 36 ${IN_BACKGROUND} && return 0
37 37
80 exit 0 80 exit 0
81 fi 81 fi
82 82
83 veinfo "Waiting for ${iface} to be marked as started" 83 veinfo "Waiting for ${iface} to be marked as started"
84 84
85 i=0 85 local i=0
86 while true ; do 86 while true ; do
87 if service_started "net.${iface}"; then 87 if service_started "net.${iface}"; then
88 local addr=$( interface_get_address "${iface}" ) 88 local addr=$( interface_get_address "${iface}" )
89 einfo "${iface} configured with address ${addr}" 89 einfo "${iface} configured with address ${addr}"
90 exit 0 90 exit 0
91 fi 91 fi
92 sleep 1 92 sleep 1
93 [[ ${timeout} == "0" ]] && continue
93 (( i++ )) 94 (( i++ ))
94 [[ ${i} == "${timeout}" || ${i} -gt "${timeout}" ]] && break 95 [[ ${i} == "${timeout}" || ${i} -gt "${timeout}" ]] && break
95 done 96 done
96 97
97 eend 1 "Failed to configure ${iface} in the background" 98 eend 1 "Failed to configure ${iface} in the background"

Legend:
Removed from v.251  
changed lines
  Added in v.252

  ViewVC Help
Powered by ViewVC 1.1.20