Browse Source

return exit code from enter.sh

tags/nilmdbuntu-1
Jim Paris 8 years ago
parent
commit
424d1e3d6f
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      enter.sh

+ 6
- 0
enter.sh View File

@@ -9,6 +9,7 @@ fi
# enter the chroot and run the command (if supplied) or a shell
. config || exit 0

FAILED=0
run() {
echo "+" "$1"
chroot ${FS} env -i \
@@ -20,6 +21,7 @@ run() {
RET=$?
if [ $RET -ne 0 ] && [ "$1" != "exec bash" ] ; then
printf "%s\n" "----------- WARNING: failed with exit code $RET"
FAILED=$RET
sleep 5
fi
}
@@ -57,3 +59,7 @@ umount ${FS}/sys
umount ${FS}/proc

echo "cleaned up"
if [ $FAILED -ne 0 ] ; then
exit $FAILED
fi
exit 0

Loading…
Cancel
Save