Commit 57f14646 authored by Martin Peres's avatar Martin Peres
Browse files

initscript: be more resistant to network-setting failures

parent f90cfd20
......@@ -130,9 +130,8 @@ function load_modules {
}
function connect {
ip link set eth0 up
udhcpc -i eth0 -s /etc/uhdcp-default.sh -T 1
ip link set eth0 up || return 1
udhcpc -i eth0 -s /etc/uhdcp-default.sh -T 1 || return 1
log "Getting IP: DONE"
}
......@@ -434,13 +433,15 @@ load_modules $ARG_MODULES
mount_cache_partition
# Connect to the network, now that the modules are loaded
connect
# Set the time
ntp_set $ARG_NTP_PEER
# Start the containers
run_containers
if connect; then
# Set the time
ntp_set $ARG_NTP_PEER
# Start the containers
run_containers
else
log "ERROR: Could not connect to the network, shutting down!"
fi
# Shutdown command
sync
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment