|
|
@ -39,21 +39,21 @@ if [ ! -w `pwd` ]; then |
|
|
|
exit 1 |
|
|
|
exit 1 |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
if [[ $curl_exists == "true" && $wget_exists == "true" ]]; then |
|
|
|
# Parse all commandline options |
|
|
|
prompt="Detected both curl and wget, which one would you like to use? [default is curl]" |
|
|
|
while [[ "$#" -gt 0 ]]; do |
|
|
|
options=("curl" "wget") |
|
|
|
case $1 in |
|
|
|
PS3="$prompt " |
|
|
|
-w|--wget) force_wget="true"; break;; |
|
|
|
select opt in "${options[@]}" "Quit"; do |
|
|
|
*) echo "Unknown parameter: $1"; exit 1;; |
|
|
|
case "$REPLY" in |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 ) download_command="curl -O "; break;; |
|
|
|
|
|
|
|
2 ) download_command="wget "; break;; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(( ${#options[@]}+1 )) ) echo "Goodbye!"; exit 1;; |
|
|
|
|
|
|
|
*) download_command="curl -O "; break;; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
esac |
|
|
|
esac |
|
|
|
|
|
|
|
shift |
|
|
|
done |
|
|
|
done |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [[ $curl_exists == "true" && $wget_exists == "true" ]]; then |
|
|
|
|
|
|
|
if [[ $force_wget == "true" ]]; then |
|
|
|
|
|
|
|
download_command="wget " |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
download_command="curl -O " |
|
|
|
|
|
|
|
fi |
|
|
|
elif [[ $curl_exists == "true" ]]; then |
|
|
|
elif [[ $curl_exists == "true" ]]; then |
|
|
|
download_command="curl -O " |
|
|
|
download_command="curl -O " |
|
|
|
elif [[ $wget_exists == "true" ]]; then |
|
|
|
elif [[ $wget_exists == "true" ]]; then |
|
|
|