#!/bin/bash
System=$(hostnamectl |grep System|awk '{print $3,$4,$5}')
Kernel=$(hostnamectl|grep Kernel|awk -F: '{print $2}')
Vt=$(hostnamectl|grep Virtualization|awk '{print $2}')
Statichostname=$(hostnamectl|grep "Static hostname"|awk '{print $3}')
Eth0=$(ifconfig eth0|awk 'NR==2{print $2}')
Lo=$(ifconfig lo|awk 'NR==2{print $2}')
Network_T=$(curl -s icanhazip.com)
echo "当前系统版本是: $System"
echo "当前系统内核是: $Kernel"
echo "当前虚拟平台是: $Vt"
echo "当前静态主机名是: $Statichostname"
echo "当前Eth0IP地址是: $Eth0"
echo "当前lo地址是: $Lo"
echo "当前外网地址是: $Network_T"
评论