create function `curl`, instead of alias `curl`

Try to fix #132.
> `-q`: Disable .curlrc
> `-L`: Follow redirects
> `--false-start`: Enable TLS False Start
> `--http2`: Use HTTP 2
> `--tlsv1.2`: Use TLSv1.2 or greater
pull/139/head
IceCodeNew 2020-09-24 20:54:41 +08:00
parent b990f89b6e
commit 2cf0c90b01
1 changed files with 3 additions and 1 deletions

View File

@ -27,7 +27,9 @@ red=$(tput setaf 1)
green=$(tput setaf 2)
reset=$(tput sgr0)
alias curl='"curl" --retry 5 --retry-delay 10 --retry-max-time 60 --false-start --http2 --tlsv1.2 -L'
curl() {
$(type -P curl) -L -q --retry 5 --retry-delay 10 --retry-max-time 60 --false-start --http2 --tlsv1.2 "$@"
}
check_if_running_as_root() {
# If you want to run as another user, please modify $UID to be owned by this user