save point

This commit is contained in:
kake26 2024-06-10 20:55:40 -05:00
parent 38f475d045
commit 89f514ce60
Signed by: kake26
GPG key ID: E8AFC43591876B4D
3 changed files with 18 additions and 4 deletions

View file

@ -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