diff --git a/openair-cn/SCRIPTS/utils.bash b/openair-cn/SCRIPTS/utils.bash index 97222be1f16000e9a564e2b39507679e79064648..3534ebe52d61b3852678593f0ba6342a6d76fa31 100755 --- a/openair-cn/SCRIPTS/utils.bash +++ b/openair-cn/SCRIPTS/utils.bash @@ -213,6 +213,20 @@ assert() { fi } +test_command_install_lib() { + # usage: test_command_install_package searched_binary package_to_be_installed_if_binary_not_found optional_option_to_apt_get_install + if [ ! -f $1 ]; then + echo_warning "$2 seems to be not installed, trying..." + apt-get install $2 -y + if [ ! -f $1 ]; then + echo_error "$1 unavailable" + exit 1 + fi + fi + echo_success "$1 available" +} + + test_command_install_package() { # usage: test_command_install_package searched_binary package_to_be_installed_if_binary_not_found optional_option_to_apt_get_install if [ $# -eq 2 ]; then