Tim Edwards | debc0a4 | 2020-12-28 22:11:40 -0500 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # |
| 3 | # Neither curl or wget are guaranteed to be included in all *nix systems, |
| 4 | # (but most have *one* of them). This tools tries its best to find one. |
| 5 | # |
| 6 | |
| 7 | DL_CMD= |
| 8 | if type "wget" > /dev/null; then |
| 9 | DL_CMD="wget -qO" |
| 10 | fi |
| 11 | |
| 12 | if type "curl" > /dev/null; then |
| 13 | DL_CMD="curl -sLo" |
| 14 | fi |
| 15 | |
| 16 | if [ "$DL_CMD" = "" ]; then |
| 17 | echo "Either curl or wget are required to automatically install tools." |
| 18 | exit 1 |
| 19 | fi |
| 20 | |
| 21 | echo "Downloading $1 to $2..." |
| 22 | $DL_CMD $2 $1 |