mirror of
https://github.com/rocky-linux/rocky-tools.git
synced 2024-11-22 05:01:25 +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
@ -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 New Issue
Block a user