Last active
March 8, 2016 12:03
-
-
Save LadyNamedLaura/e18b00742f8ea4e51535 to your computer and use it in GitHub Desktop.
download with locking :-)
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 | |
set -e | |
set -x | |
exec 100> "$2.tmp" | |
flock -n 100 | |
curl "$1" -o "/dev/fd/100" | |
mv "$2.tmp" "$2" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment