diff --git a/scripts/alpine_boostrap.sh b/scripts/alpine_boostrap.sh index dc860b7..c461f42 100644 --- a/scripts/alpine_boostrap.sh +++ b/scripts/alpine_boostrap.sh @@ -1,6 +1,23 @@ #!/bin/bash +set -e + if [ "$EUID" -ne 0 ]; then echo "Error: This script must be run as root" >&2 exit 1 fi + +if [ ! -d "/var/lib/matchbox/assets" ]; then + echo "Error: Folder /var/lib/matchbox/assets does not exist." >&2 + exit 1 +fi + +if ! curl -sSL -o /var/lib/matchbox/assets/vmlinuz https://dl-cdn.alpinelinux.org/alpine/latest-stable/releases/x86_64/netboot/vmlinuz-lts; then + echo "Error: Failed to download alpine vmlinuz." >&2 + exit 1 +fi + +if ! curl -sSL -o /var/lib/matchbox/assets/initramfs https://dl-cdn.alpinelinux.org/alpine/latest-stable/releases/x86_64/netboot/initramfs-lts; then + echo "Error: Failed to download alpine initramfs." >&2 + exit 1 +fi