#! /bin/bash # script checks installed packets/RPMs . /usr/src/k_framework/main.sh # ---- VARS ----- VERSION="1.1.1" SCRIPT_NAME="Packets Checking" TEST=0 # 1 - do not execute changes # ---- FUNCTIONS ----- rpm_installed_check(){ if cat /tmp/check_rpms | grep -q "$1"; then report "$1 installed" 0 else report "$1 not installed" 1 report " try: yum -y install $1" 1 EXIT_CODE=1 fi } # ---- MAIN ----- k_start if [ "$TEST" == "1" ]; then report "***** TEST MODE ON. Changes will not be applied *****" 8 fi k_config_details rpm -qa > /tmp/check_rpms rpm_installed_check smartmontools rpm_installed_check lshw rpm_installed_check bind-utils rpm_installed_check sysstat # iostat / m2_server_loadstats rpm_installed_check pigz rpm_installed_check yum-utils if [[ $GUI_PRESENT == 1 ]]; then rpm_installed_check libXext rpm_installed_check libSM rpm_installed_check libXrender fi if [[ $MEDIA_PRESENT == 1 ]]; then rpm_installed_check perl-Config-Tiny # for rtpengine-ctl fi # only for MOR if [[ "$SYSTEM_CONFIG_DIR" = "mor" ]]; then rpm_installed_check sox fi rm -fr /tmp/check_rpms k_exit $EXIT_CODE