save point
This commit is contained in:
parent
38f475d045
commit
89f514ce60
3 changed files with 18 additions and 4 deletions
18
sys.bash
18
sys.bash
|
@ -1,5 +1,5 @@
|
|||
#!/bin/bash
|
||||
set -x
|
||||
#set -x
|
||||
# a bash file that can provide various bits of info about the system
|
||||
|
||||
function cpuinfo() {
|
||||
|
@ -26,11 +26,23 @@ function diskinfo() {
|
|||
|
||||
function networkinfo() {
|
||||
echo "Network:"
|
||||
# We will get to this later
|
||||
# get network interfaces and usage
|
||||
|
||||
# get network adapters and usage
|
||||
adapters=$(ip -s addr | grep -E '^[0-9]:' | awk -F ':' '{print $2}')
|
||||
for adapter in $adapters; do
|
||||
rx=$(ip -s link show $adapter | awk '/RX:/ {print $2}')
|
||||
tx=$(ip -s link show $adapter | awk '/TX:/ {print $2}')
|
||||
echo -e "$adapter\tRX: $rx\tTX: $tx"
|
||||
done
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
# This seems to be a good layout for sys.bash for now
|
||||
|
||||
cpuinfo
|
||||
meminfo
|
||||
meminfo
|
||||
diskinfo
|
||||
networkinfo
|
Loading…
Add table
Add a link
Reference in a new issue