diff --git a/components/core/tools/scripts/lib_install/mongoc.sh b/components/core/tools/scripts/lib_install/mongoc.sh index ed389d3cc..183fb8622 100755 --- a/components/core/tools/scripts/lib_install/mongoc.sh +++ b/components/core/tools/scripts/lib_install/mongoc.sh @@ -43,10 +43,10 @@ if [ $installed -eq 0 ] ; then fi echo "Checking for elevated privileges..." -privileged_command_prefix="" +install_command_prefix_args=() if [ ${EUID:-$(id -u)} -ne 0 ] ; then sudo echo "Script can elevate privileges." - privileged_command_prefix="sudo" + install_command_prefix_args=("sudo") fi # Download @@ -83,10 +83,6 @@ checkinstall_installed=$? set -e # Install -install_command_prefix_args=() -if ! [ -z "${privileged_command_prefix}" ]; then - install_command_prefix_args=(${privileged_command_prefix}) -fi if [ $checkinstall_installed -eq 0 ] ; then install_command_prefix_args+=( \ checkinstall \ diff --git a/components/core/tools/scripts/lib_install/mongocxx.sh b/components/core/tools/scripts/lib_install/mongocxx.sh index 25dbd3030..6cfbd0946 100755 --- a/components/core/tools/scripts/lib_install/mongocxx.sh +++ b/components/core/tools/scripts/lib_install/mongocxx.sh @@ -43,10 +43,10 @@ if [ $installed -eq 0 ] ; then fi echo "Checking for elevated privileges..." -privileged_command_prefix="" +install_command_prefix_args=() if [ ${EUID:-$(id -u)} -ne 0 ] ; then sudo echo "Script can elevate privileges." - privileged_command_prefix="sudo" + install_command_prefix_args=("sudo") fi # Download @@ -86,10 +86,6 @@ checkinstall_installed=$? set -e # Install -install_command_prefix_args=() -if ! [ -z "${privileged_command_prefix}" ]; then - install_command_prefix_args=(${privileged_command_prefix}) -fi if [ $checkinstall_installed -eq 0 ] ; then install_command_prefix_args+=( \ checkinstall \