Skip to content

Commit 407b2ff

Browse files
committed
Fix: ensure vm init script fails on any uncaught errors
1 parent 89af21b commit 407b2ff

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

runcvm-scripts/runcvm-vm-init

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/.runcvm/guest/bin/bash
1+
#!/.runcvm/guest/bin/bash -e
22

33
# Load original environment
44
. /.runcvm/config
@@ -49,7 +49,7 @@ IF=$(ls /sys/class/net/ | grep -vE '^(lo|docker)' | head -n 1)
4949
for i in all $IF
5050
do
5151
# /sbin/sysctl -q -w -e net.ipv6.conf.$i.disable_ipv6=1 net.ipv6.conf.$i.autoconf=0 net.ipv6.conf.$i.accept_ra=0
52-
sysctl -q -w -e net.ipv6.conf.$i.disable_ipv6=1 net.ipv6.conf.$i.autoconf=0
52+
sysctl -q -w -e net.ipv6.conf.$i.disable_ipv6=1 net.ipv6.conf.$i.autoconf=0 || true
5353
done
5454

5555
# Bring up local interface
@@ -93,7 +93,7 @@ done
9393
while read -r DOCKER_RT_NET DOCKER_RT_GW DOCKER_RT_DEV DOCKER_RT_PREFSRC
9494
do
9595
[ -n "$DOCKER_RT_NET" ] && [ -n "$DOCKER_RT_GW" ] && [ -n "$DOCKER_RT_DEV" ] && \
96-
ip route add "$DOCKER_RT_NET" via "$DOCKER_RT_GW" dev "$DOCKER_RT_DEV"
96+
ip route add "$DOCKER_RT_NET" via "$DOCKER_RT_GW" dev "$DOCKER_RT_DEV" || true
9797
done </.runcvm/network/routes
9898

9999
# TODO

0 commit comments

Comments
 (0)