modify system-info.sh to show more ip address when login
This commit is contained in:
parent
ea33facb4a
commit
78b2e2de61
@ -49,8 +49,7 @@ processes=$(ps aux | wc -l)
|
|||||||
user_num=$(users | wc -w)
|
user_num=$(users | wc -w)
|
||||||
|
|
||||||
# Ip address
|
# Ip address
|
||||||
ip_pre=$(/sbin/ip a|grep inet|grep -v 127.0.0.1|grep -v inet6 | awk '{print $2}' | head -1)
|
ip_pre=$(/sbin/ip a|grep inet|grep -v 127.0.0.1|grep -v inet6 | awk '{print $2}')
|
||||||
ip_address=${ip_pre%/*}
|
|
||||||
|
|
||||||
echo -e "\n"
|
echo -e "\n"
|
||||||
echo -e "Welcome to $welcome\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 "Memory used: \t$memory_usage"
|
||||||
echo -e "Swap used: \t$swap_mem"
|
echo -e "Swap used: \t$swap_mem"
|
||||||
echo -e "Usage On: \t$usageof"
|
echo -e "Usage On: \t$usageof"
|
||||||
|
for line in $ip_pre
|
||||||
|
do
|
||||||
|
ip_address=${line%/*}
|
||||||
echo -e "IP address: \t$ip_address"
|
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" ]
|
if [ "$whoiam"=="root" ]
|
||||||
then
|
then
|
||||||
echo -e "\n"
|
echo -e "\n"
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
%define dist_release_version 8
|
%define dist_release_version 8
|
||||||
%define generic_version 20.03
|
%define generic_version 20.03
|
||||||
%define generic_patch_level LTS
|
%define generic_patch_level LTS
|
||||||
%define generic_release 38
|
%define generic_release 39
|
||||||
%define builtin_release_version 1.0
|
%define builtin_release_version 1.0
|
||||||
|
|
||||||
%define current_arch %{_arch}
|
%define current_arch %{_arch}
|
||||||
@ -136,6 +136,9 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
/etc/profile.d/performance.sh
|
/etc/profile.d/performance.sh
|
||||||
|
|
||||||
%changelog
|
%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
|
* Fri June 19 2020 shenyangyang <shenyangyang4@huawei.com> - 1.0-38
|
||||||
- change build requires of python to python3
|
- change build requires of python to python3
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user