#!/bin/dash
# attempt to download kernel $KERNEL_VERSION from ibiblio
# and then copy it as vmlinuz/kernel-modules.sfs

### configuration
SRC_URL=http://distro.ibiblio.org/fatdog/kernels/700
#KERNEL_VERSION=3.12.9 # default is blank - use "vmlinuz"
KVER=${KERNEL_VERSION:+-$KERNEL_VERSION} # prepend dash

### main
[ -e kernel/vmlinuz$KVER ] && exit
wget -P kernel -c $SRC_URL/vmlinuz$KVER
wget -P kernel -c $SRC_URL/kernel-modules.sfs$KVER
if [ "$KVER" ]; then
	cp kernel/vmlinuz$KVER kernel/vmlinuz
	cp kernel/kernel-modules.sfs$KVER kernel/kernel-modules.sfs
fi
echo vmlinuz$KVER ready.
