9
0
Fork 0

defaultenv-2 ifup: create network up state file for dhcp

We store the 'up' status of a network device in /tmp/network/$interface.
Create this file for dhcp aswell to prevent doing dhcp requests each
time ifup is called.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2012-06-24 13:07:25 +02:00
parent 52c31adcb0
commit c5d53f0efd
1 changed files with 6 additions and 3 deletions

View File

@ -51,14 +51,17 @@ if [ "$ip" = static ]; then
${interface}.netmask=$netmask
${interface}.serverip=$serverip
${interface}.gateway=$gateway
ret=0
elif [ "$ip" = dhcp ]; then
dhcp
ret=$?
if [ $ret = 0 -a -n "$serverip" ]; then
${interface}.serverip=$serverip
fi
exit $ret
fi
echo -o /tmp/network/$interface up
if [ $ret = 0 ]; then
echo -o /tmp/network/$interface up
fi
exit $ret