Fix syntax errors

This commit is contained in:
yaokai13 2021-12-01 11:02:26 +08:00
parent 75b78ba201
commit 7bfb0f81c6
2 changed files with 6 additions and 3 deletions

View File

@ -22,7 +22,7 @@ swap_total=$(cat /proc/meminfo | awk '/^SwapTotal:/ { printf($2)}')
swap_free=$(cat /proc/meminfo | awk '/^SwapFree:/ { printf($2)}')
if [ $memory_total -gt 0 ]
if [[ $memory_total -gt 0 ]]
then
memory_usage=`echo "scale=1; ($memory_total - $memory_free - $buffers - $cached - $sreclaimable) * 100.0 / $memory_total" |bc`
memory_usage="${memory_usage}%"
@ -31,7 +31,7 @@ else
fi
# Swap memory
if [ $swap_total -gt 0 ]
if [[ $swap_total -gt 0 ]]
then
swap_mem=`echo "scale=1; ($swap_total - $swap_free) * 100.0 / $swap_total" |bc`
swap_mem="${swap_mem}%"

View File

@ -5,7 +5,7 @@
%define dist_release_version 8
%define generic_version 20.03
%define generic_patch_level LTS
%define generic_release 48
%define generic_release 49
%define builtin_release_version 1.0
%define current_arch %{_arch}
@ -136,6 +136,9 @@ rm -rf $RPM_BUILD_ROOT
/etc/profile.d/performance.sh
%changelog
* Wed Dec 01 2021 yaokai <yaokai13@huawei.com> - 1.0.49
- Fix syntax errors
* Mon Nov 29 2021 yaokai <yaokai13@huawei.com> - 1.0.48
- recover the dependency for bc