This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
tsg-tsg-performance-test-tools/tsg-rpm-script/check_tsg_installed_rpm_version.sh

20 lines
489 B
Bash

#!/bin/bash
RPM_VERSION_FILE="rpm_version.yml"
if [ ! -f "${RPM_VERSION_FILE}" ]; then
echo "Please download ${RPM_VERSION_FILE} form https://git.mesalab.cn/tsg/tsg-os-buildimage/"
exit 0
fi
RPM_ARRAY=`cat ${RPM_VERSION_FILE} | grep ":" | grep "[0-9]" | awk -F ":" '{print $2}'`
for rpm in ${RPM_ARRAY}
do
printf "[%-35s]\t" "${rpm}"
is_install=`rpm -qa | grep ${rpm} | wc -l`
if [ $is_install -eq 1 ];then
printf "[install]\n"
else
printf "\e[31m[uninstall]\e[0m\n"
fi
done