View | Details | Raw Unified | Return to bug 141554
Collapse All | Expand All

(-)scripts/ifplugd-selectif (+20 lines)
Lines 117-122 Link Here
117
			fi
117
			fi
118
		done
118
		done
119
		;;
119
		;;
120
	should_be_up)
121
		# Checks if an interface which is controlled by ifplugd should
122
		# currently be up and running (==> returns 0)
123
		ifplugstatus -q $INTERFACE
124
		if [ $? -eq 2 ] ; then
125
			mesg "`printf "    %-9s cable is connected" "$INTERFACE"`" 
126
			info_mesg "`printf "    %-9s has priority %s" "$INTERFACE" "$PRIORITY"`"
127
			if [ $PRIORITY -gt 0 ] ; then
128
				for IF in $MAJOR; do
129
					ifplugstatus -q $IF
130
					test $? -eq 2 || continue
131
					mesg "`printf "    %-9s has lesser priority than '%s'" "$INTERFACE" "$IF"`"
132
					exit 1
133
				done
134
			fi
135
		else
136
			mesg "`printf "    %-9s no cable connected" "$INTERFACE"`" 
137
			exit 1
138
		fi
139
		;;
120
esac
140
esac
121
		
141
		
122
exit 0
142
exit 0
(-)scripts/ifup (-3 / +29 lines)
Lines 823-831 Link Here
823
fi
823
fi
824
824
825
######################################################################
825
######################################################################
826
# bringing up/down the interface (main part)
826
# bringing up/down or checking the interface (main part)
827
#
827
#
828
828
829
# Check status if iflugd first. If ifplugd is running the interface
830
# need not to be up always.
831
if [ "$SCRIPTNAME" == ifstatus -a "$STARTMODE" == ifplugd ] ; then
832
	debug "Checking ifplugd status"
833
	ifplugd_retcode=$R_SUCCESS
834
	if [ "$HWD_INTERFACETYPE_0" != "wlan" ]; then
835
		MESSAGE="`$IFPLUGD -c -i $INTERFACE 2>&1`"
836
		test "$?" -ne 0 && ifplugd_retcode=$R_NO_IFPLUGD
837
		debug "$MESSAGE"
838
		message "`printf "    %-9s ifplugd is running" "$INTERFACE"`"
839
	fi
840
	if ifplugd-selectif $INTERFACE should_be_up; then
841
		# if interface should be up and running
842
		# then we unset ifplugd_retcode. Then the
843
		# normal status section will decide if the
844
		# interface is set up correctly
845
		if [ $ifplugd_retcode -eq 0 ] ; then
846
			unset ifplugd_retcode
847
		fi
848
	fi
849
fi
850
829
dhcpretcode=$R_SUCCESS
851
dhcpretcode=$R_SUCCESS
830
# switch type. If SKIP_MAIN_PART == skip, don't execute any section
852
# switch type. If SKIP_MAIN_PART == skip, don't execute any section
831
case "$BOOTPROTO$SKIP_MAIN_PART" in
853
case "$BOOTPROTO$SKIP_MAIN_PART" in
Lines 1173-1180 Link Here
1173
# returns R_NOTRUNNING while the interface is already UP. This must also be
1195
# returns R_NOTRUNNING while the interface is already UP. This must also be
1174
# passed to rcnetwork, else rcnetwork assumes that the interface is set up
1196
# passed to rcnetwork, else rcnetwork assumes that the interface is set up
1175
# correctly. (See bug 134899)
1197
# correctly. (See bug 134899)
1176
# if [ "$dhcpretcode" = $R_DHCP_BG ] ; then
1198
# Beside this we have to respect the status of ifplugd for interfaces with
1177
if [ "$dhcpretcode" != $R_SUCCESS ] ; then
1199
# STARTMODE=ifplugd. If ifplugd_retcode is set, then this value takes 
1200
# priority over other reurn codes.
1201
if [ -n "$ifplugd_retcode" ] ; then
1202
	exithook $ifplugd_retcode
1203
elif [ "$dhcpretcode" != $R_SUCCESS ] ; then
1178
	exithook $R_DHCP_BG
1204
	exithook $R_DHCP_BG
1179
else
1205
else
1180
	if [ "$retcode" = 0 -a -n "$retcode_mtu" -a "$retcode_mtu" != 0 ] ; then
1206
	if [ "$retcode" = 0 -a -n "$retcode_mtu" -a "$retcode_mtu" != 0 ] ; then

Return to bug 141554