From 6969d896cd18a3ab83ae5adcdb1e27f5ba4370fc Mon Sep 17 00:00:00 2001 From: James Swineson Date: Tue, 9 Apr 2019 17:05:54 +0800 Subject: [PATCH] correctly check for rootfs url --- README.md | 2 +- menhera.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 702ce02..3f049be 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ with only SSH! * Linux kernel: overlayfs and tmpfs support * systemd * squashfs-tools - * wget + * curl ## Usage diff --git a/menhera.sh b/menhera.sh index 047dfce..a9a8fe5 100755 --- a/menhera.sh +++ b/menhera.sh @@ -24,7 +24,7 @@ confirm() { } get_rootfs() { - if [ -z ${ROOTFS+x} ]; then + if [ -n ${ROOTFS} ]; then 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="https://images.linuxcontainers.org/images/debian/stretch/amd64/default/${ROOTFS_TIME}/rootfs.squashfs" @@ -59,7 +59,7 @@ prepare_environment() { mkdir -p "${WORKDIR}/overlayfs_workdir" echo "Downloading temporary rootfs..." - wget -c "${ROOTFS}" -O "${WORKDIR}/rootfs.squashfs" + curl -LC -o "${WORKDIR}/rootfs.squashfs" - "${ROOTFS}" } mount_new_rootfs() {