update URL parsing

This commit is contained in:
James Swineson 2019-04-09 18:09:20 +08:00
parent 5c163f0deb
commit 47df8e9ef5

View file

@ -29,7 +29,7 @@ get_rootfs() {
# forgive me for parsing HTML with these shit
# and hope it works
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 -fsSL "https://images.linuxcontainers.org/images/debian/stretch/amd64/default/?C=M;O=D" | grep -oP '(\d{8}_\d{2}:\d{2})' | head -n 1)
ROOTFS="https://images.linuxcontainers.org/images/debian/stretch/amd64/default/${ROOTFS_TIME}/rootfs.squashfs"
else