If network configuration is failed due to some reason, tfm cannot be
proceeded. In this case, reboot the system to retry when network setup
fails.
Change-Id: Idb615fb455ea2af9226c5caf395e1a06bb94e954
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
print_ip() {
IPADDR=`"$IP" -4 addr show $NETIF | "$GREP" -oP '(?<=inet\s)\d+(\.\d+){3}'`
if [ "z$IPADDR" == "z" ]; then
- echo "IP address is not set, using default (192.168.0.100)"
IPADDR="192.168.0.100"
- "$IFCONFIG" $NETIF $IPADDR up
+ RESULT=`"$IFCONFIG" $NETIF $IPADDR up`
+
+ if [ "z$RESULT" != "z" ]; then
+ echo "Failed to set IP address, Reboot..."
+ "$REBOOT"
+ fi
+
+ echo "IP address is not set, using default (192.168.0.100)"
fi
echo "IP address is set to ${IPADDR}"
}
#------------------------------------------------
# Main Routine Start
#------------------------------------------------
-clear_bootmode
print_ip
+clear_bootmode
do_flash