diff --git a/docker/startup.sh b/docker/startup.sh index 54f541f..19f5b60 100755 --- a/docker/startup.sh +++ b/docker/startup.sh @@ -10,11 +10,13 @@ if [ -f "/mnt/$DISK_FILENAME" ]; then [ -w "/mnt/$DISK_FILENAME" ] || { echo "Disk /mnt/$DISK_FILENAME exists and is not writable"; exit 1; } echo "Disk found and is writable." else - [ -w "/mnt/" ] || { echo "Disk /mnt/$DISK_FILENAME not found and /mnt not writable"; exit 1; } - [ -f "/rq0.dsk.gz" ] || { echo "Disk /mnt/$DISK_FILENAME not found and image was not built with a default disk"; exit 1; } - echo "Disk not found." - echo "Extracting default disk image..." - gzip -cd /rq0.dsk.gz > "/mnt/$DISK_FILENAME" || { echo "Failed to extract default disk image to /mnt/$DISK_FILENAME"; exit 1; } + [ -w "/mnt/" ] || { echo "Disk /mnt/$DISK_FILENAME not found and /mnt not writable"; exit 1; } + [ -f "/rq0.dsk.gz" ] || + { echo "Disk /mnt/$DISK_FILENAME not found and image was not built with a default disk"; exit 1; } + echo "Disk not found." + echo "Extracting default disk image..." + gzip -cd /rq0.dsk.gz > "/mnt/$DISK_FILENAME" || + { echo "Failed to extract default disk image to /mnt/$DISK_FILENAME"; exit 1; } fi # Start CoreDNS as soon as possible after validations done @@ -26,6 +28,8 @@ coredns "$COREDNS_QUIET" -conf /Corefile & [ -z "$NOEXIT" ] && EXIT_CMD="exit" || EXIT_CMD="" echo "Configuring simh..." +# Allow overriding boot.ini.template +[ -f /mnt/boot.ini.template ] && cp -f /mnt/boot.ini.template /mnt/boot.ini.template sed -e "s//${DISK_FILENAME}/" \ -e "s//${EXIT_CMD}/" /boot.ini.template > /boot.ini