Created
November 21, 2014 11:00
-
-
Save GeoffWilliams/81e48fdb596767bcae5f to your computer and use it in GitHub Desktop.
Download a directory of files from webserver and save to /shared directory - for setting up classrooms
This file contains hidden or 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/bash | |
| # | |
| # download files from laptop webserver in VM to teach fundamentals module | |
| # usage: | |
| # ./classroom_files.sh DOWNLOAD_URL | |
| # | |
| # DOWNLOAD_URL should be a directory of files on an http server | |
| BASE_URL=$1 | |
| DOWNLOAD_DIR="/shared" | |
| WGET_COMMAND="wget -r -nH --cut-dirs=2 --no-parent --reject=index.html* --directory-prefix=${DOWNLOAD_DIR}" | |
| if [ "$BASE_URL" == "" ] ; then | |
| echo "Please supply a URL to download from" | |
| exit 1 | |
| fi | |
| $WGET_COMMAND $BASE_URL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment