mirror of
https://github.com/rocky-linux/rocky-tools.git
synced 2024-12-28 20:50:54 +00:00
Use type builtin to check for the existence of the curl command.
There is no need to actually execute curl in order to check that it exists on the system, the type builtin can tell us without having to fork the command.
This commit is contained in:
parent
d643676189
commit
64dbbde473
1 changed files with 1 additions and 1 deletions
|
@ -23,7 +23,7 @@ if [[ "$(id -u)" -ne 0 ]]; then
|
|||
"${errcolor}Either use sudo or 'su -c ${0}'$nocolor"
|
||||
fi
|
||||
|
||||
if [[ "$(curl 2>/dev/null || echo $?)" == 127 ]]; then
|
||||
if ! type curl >/dev/null 2>&1; then
|
||||
printf "${blue}Curl is not installed! Installing it...$nocolor"
|
||||
dnf -y install curl libcurl
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue