-
-
Save zdi-team/7bcf4c0d52b733a48e80a49c5b6607db to your computer and use it in GitHub Desktop.
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
get_tar_by_url () | |
{ | |
mkdir $TMP_DIR | |
if [ "$NOPROMPT" -eq 0 ]; then | |
echo "Trying to get upgrade file from $TAR" | |
fi | |
if [ -n "$USERNAME" ]; then | |
auth="-u $USERNAME:$PASSWORD" | |
else | |
auth="" | |
fi | |
filename="${TMP_DIR}/${TAR##*/}" | |
if [ "$NOPROMPT" -eq 0 ]; then | |
curl -k $auth -f -L -o $filename $TAR # <----- | |
else | |
curl -k $auth -f -s -L -o $filename $TAR # <----- | |
fi | |
if [ $? -ne 0 ]; then | |
echo "Unable to get upgrade file from $TAR" | |
rm -f $filename | |
rm -f $DOWNLOADING | |
exit 1 | |
fi | |
if [ ! -e $filename ]; then | |
echo "Download of $TAR failed" | |
rm -f $DOWNLOADING | |
exit 1 | |
fi | |
if [ "$NOPROMPT" -eq 0 ]; then | |
echo "Download succeeded" | |
fi | |
TAR=$filename | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment