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

(-)sbin/ifup-dhcp (+43 lines)
Lines 63-71 case "${SCRIPTNAME}" in Link Here
63
	ifup-*) ACTION=start ;;
63
	ifup-*) ACTION=start ;;
64
	ifdown-*) ACTION=stop ;;
64
	ifdown-*) ACTION=stop ;;
65
	ifstatus-*) ACTION=status ;;
65
	ifstatus-*) ACTION=status ;;
66
	ifrenew-*) ACTION=renew ;;
66
	*) usage
67
	*) usage
67
esac
68
esac
68
69
70
SAVED_ARGS=("$@")
71
69
INTERFACE=$1
72
INTERFACE=$1
70
case "$INTERFACE" in ""|-h|*help*) usage; esac
73
case "$INTERFACE" in ""|-h|*help*) usage; esac
71
shift
74
shift
Lines 384-389 case "$ACTION" in Link Here
384
			ip link set down dev $INTERFACE
387
			ip link set down dev $INTERFACE
385
		fi
388
		fi
386
		;;
389
		;;
390
	renew)
391
		debug "Renew lease on $INTERFACE"
392
393
		case $DHCLIENT in 
394
		dhcpcd) 
395
			if [ "$INTERFACE" = 'all' ]; then
396
				killall -ALRM $DHCLIENT_BIN &>/dev/null
397
			else
398
				# let's first test if any dhcpcd processes are running on this
399
				# interface.  Unfortunately, the pid file is not there when it starts
400
				# up, so we can't rely on that.  Normally, only one process is running
401
				# per interface. but we have made bad experiences with ...hotplug 
402
				for i in `pidof $DHCLIENT`; do
403
					case $(cat /proc/$i/cmdline) in
404
						*$INTERFACE*) dhcpcd_on_device="$dhcpcd_on_device $i"
405
					esac
406
				done
407
408
				if [ -z "$dhcpcd_on_device" ]; then
409
					exec /sbin/ifup "$SAVED_ARGS"
410
				fi
411
412
				# wait until the processes are gone
413
				for i in $dhcpcd_on_device; do
414
					kill -ALRM $i &>/dev/null
415
				done
416
417
				true
418
			fi
419
420
			;;
421
422
		dhclient)
423
			# no idea what to do here
424
			message "renew for dhclient not supported"
425
			false
426
			;;
427
		esac
428
429
		;;
387
	status)
430
	status)
388
		if test -z "`ip -o -f inet addr show $INTERFACE`"; then
431
		if test -z "`ip -o -f inet addr show $INTERFACE`"; then
389
			# interface has currently no ipv4 address assigned
432
			# interface has currently no ipv4 address assigned

Return to bug 143329