!27 modify system-info.sh to show more ip address when login

Merge pull request !27 from Anonymous_Z/zhangrui182
This commit is contained in:
openeuler-ci-bot 2020-08-06 11:15:24 +08:00 committed by Gitee
commit 2c0bea807b
2 changed files with 11 additions and 5 deletions

View File

@ -49,8 +49,7 @@ processes=$(ps aux | wc -l)
user_num=$(users | wc -w)
# Ip address
ip_pre=$(/sbin/ip a|grep inet|grep -v 127.0.0.1|grep -v inet6 | awk '{print $2}' | head -1)
ip_address=${ip_pre%/*}
ip_pre=$(/sbin/ip a|grep inet|grep -v 127.0.0.1|grep -v inet6 | awk '{print $2}')
echo -e "\n"
echo -e "Welcome to $welcome\n"
@ -60,8 +59,12 @@ echo -e "Processes: \t$processes"
echo -e "Memory used: \t$memory_usage"
echo -e "Swap used: \t$swap_mem"
echo -e "Usage On: \t$usageof"
for line in $ip_pre
do
ip_address=${line%/*}
echo -e "IP address: \t$ip_address"
echo -e "Users online: \t$user_num\n"
done
echo -e "Users online: \t$user_num"
if [ "$whoiam"=="root" ]
then
echo -e "\n"

View File

@ -5,7 +5,7 @@
%define dist_release_version 8
%define generic_version 20.03
%define generic_patch_level LTS
%define generic_release 38
%define generic_release 39
%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
* Thu Aug 6 2020 zhangrui <zhangrui182@huawei.com> - 1.0-39
- modify system-info.sh to show more ip address when login
* Fri June 19 2020 shenyangyang <shenyangyang4@huawei.com> - 1.0-38
- change build requires of python to python3