correctly check for rootfs url

This commit is contained in:
James Swineson 2019-04-09 17:05:54 +08:00
parent f8d5462eb2
commit 6969d896cd
2 changed files with 3 additions and 3 deletions

View file

@ -21,7 +21,7 @@ with only SSH!
* Linux kernel: overlayfs and tmpfs support * Linux kernel: overlayfs and tmpfs support
* systemd * systemd
* squashfs-tools * squashfs-tools
* wget * curl
## Usage ## Usage

View file

@ -24,7 +24,7 @@ confirm() {
} }
get_rootfs() { get_rootfs() {
if [ -z ${ROOTFS+x} ]; then if [ -n ${ROOTFS} ]; then
echo "Getting rootfs URL..." echo "Getting rootfs URL..."
ROOTFS_TIME=$(curl "https://uk.images.linuxcontainers.org/images/debian/stretch/amd64/default/?C=M;O=D" | grep "folder.gif" | head -n 1 | cut -d'>' -f7 | cut -d'/' -f1) ROOTFS_TIME=$(curl "https://uk.images.linuxcontainers.org/images/debian/stretch/amd64/default/?C=M;O=D" | grep "folder.gif" | head -n 1 | cut -d'>' -f7 | cut -d'/' -f1)
ROOTFS="https://images.linuxcontainers.org/images/debian/stretch/amd64/default/${ROOTFS_TIME}/rootfs.squashfs" ROOTFS="https://images.linuxcontainers.org/images/debian/stretch/amd64/default/${ROOTFS_TIME}/rootfs.squashfs"
@ -59,7 +59,7 @@ prepare_environment() {
mkdir -p "${WORKDIR}/overlayfs_workdir" mkdir -p "${WORKDIR}/overlayfs_workdir"
echo "Downloading temporary rootfs..." echo "Downloading temporary rootfs..."
wget -c "${ROOTFS}" -O "${WORKDIR}/rootfs.squashfs" curl -LC -o "${WORKDIR}/rootfs.squashfs" - "${ROOTFS}"
} }
mount_new_rootfs() { mount_new_rootfs() {