summaryrefslogtreecommitdiffstats
path: root/core/rootfs/rootfs-stage31/data/inc/setup_network
diff options
context:
space:
mode:
Diffstat (limited to 'core/rootfs/rootfs-stage31/data/inc/setup_network')
-rw-r--r--core/rootfs/rootfs-stage31/data/inc/setup_network10
1 files changed, 8 insertions, 2 deletions
diff --git a/core/rootfs/rootfs-stage31/data/inc/setup_network b/core/rootfs/rootfs-stage31/data/inc/setup_network
index 76195780..6a196b82 100644
--- a/core/rootfs/rootfs-stage31/data/inc/setup_network
+++ b/core/rootfs/rootfs-stage31/data/inc/setup_network
@@ -95,9 +95,11 @@ wait_for_iface "$BRIDGE"
PARAM=
if [ -n "$CLIENTIP" ]; then
PARAM="-r $CLIENTIP"
+ echo -n "$CLIENTIP" > "/run/firstip"
+fi
+if [ -n "$GATEWAY" ]; then
+ echo -n "$GATEWAY" > "/run/firstgw"
fi
-echo -n "$CLIENTIP" > "/run/firstip"
-echo -n "$GATEWAY" > "/run/firstgw"
# save our variables for retry on fail ff.
echo "CLIENTIP=$CLIENTIP" >> /run/network.conf
@@ -105,4 +107,8 @@ echo "GATEWAY=$GATEWAY" >> /run/network.conf
echo "BRIDGE=$BRIDGE" >> /run/network.conf
udhcpc $PARAM -O ntpsrv -O domain -O wpad -O search -t 5 -T 2 -s "/inc/udhcpc-trigger" -f -n -q -i "$BRIDGE"
+URET=$?
# udhcpc return value will be return value of this script
+[ -z "$CLIENTIP" ] && CLIENTIP=$(cat /run/firstip)
+[ -z "$GATEWAY" ] && GATEWAY=$(cat /run/firstgw)
+return $URET