Trap errors

This commit is contained in:
Kroese 2023-05-03 18:01:35 +02:00 committed by GitHub
parent 77de3a9f25
commit d7c0b0c2d1

View File

@ -15,6 +15,9 @@ echo "Starting Virtual DSM for Docker v${VERSION}..."
STORAGE="/storage"
KERNEL=$(uname -r | cut -b 1)
trap 'echo >&2 "Error - exited with status $? at line $LINENO:";
pr -tn $0 | tail -n+$((LINENO - 3)) | head -n7 >&2' ERR
[ ! -d "$STORAGE" ] && echo "Storage folder (${STORAGE}) not found!" && exit 69
[ ! -f "/run/run.sh" ] && echo "Script must run inside Docker container!" && exit 60