diff --git a/README.md b/README.md index ebcdcc6..8efcf42 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ A framework for making bash scripts with some useful features # The config scripts -One uses JQ the other awk,grep and sed. They basically achieve the same thing though to allow you to have a config file for a bash script. Good for keeping things like passwords and such out of the script itself. JQ is a external requirement that might need to be installed as to the where the others are likley already there. JQ runs on basically any platform, so its not a big issue. Even on my router so there is that. +One uses JQ the other awk,grep and sed. They basically achieve the same thing though to allow you to have a config file for a bash script. Good for keeping things like passwords and such out of the script itself. JQ is a external requirement that might need to be installed as to the where the others are likley already there. JQ runs on basically any platform, so its not a big issue. Even on my router so there is that. These alone have no end of uses. Great for seperating out user names and passwords from code. I like to json and add config.json into .gitignore for any projects I open source using bash. Very useful. # Where did the name come from? diff --git a/ntfy.bash b/ntfy.bash index 9c84f39..23fa1af 100644 --- a/ntfy.bash +++ b/ntfy.bash @@ -1,5 +1,7 @@ #!/bin/bash +# was split out to a seperate project, but will be pulled in when done + # check for curl if ! command -v curl &> /dev/null diff --git a/sys.bash b/sys.bash index 9d18dce..758afa4 100755 --- a/sys.bash +++ b/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 \ No newline at end of file +meminfo +diskinfo +networkinfo \ No newline at end of file