Created
May 5, 2022 12:20
-
-
Save dlangille/54924a9cfcdb014306eb042c19014cfb to your computer and use it in GitHub Desktop.
download stuff, make it LATEST - see https://twitter.com/DLangille/status/1522026048229097472
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
DST="/tmp/dvl" | |
WGET="/usr/local/bin/wget" | |
URL_BASE="https://example.net/downloads/stuff/" | |
mkdir $DST | |
cd $DST | |
$WGET -O new_download "$URL_BASE/LATEST" | |
LATEST=$(cat new_download) | |
if [ -d $LATEST ] | |
then | |
exit | |
fi | |
$WGET -P $LATEST --no-if-modified-since --mirror --no-parent -r -nd --https-only "$URL_BASE/$LATEST/" | |
mv new_download LATEST |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment