-
-
Save havocesp/1eec156c5227de6a2770eb3ca0769872 to your computer and use it in GitHub Desktop.
Download file from url if exists, otherwise return non-zero value to system.
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
function ftp_get(){ | |
ftp -V "$1" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using command ftp with URL file as argument assures either remote file copy or an error (non-zero value return).
Otherwise, other commands like wget, under somre situations wille read html response and output it as file returning a zero value to system so we get undesired file with a non error return.