Another try for showing IP

19834aca25
This commit is contained in:
Igor Pecovnik 2016-06-09 20:00:46 +02:00
parent 1aa8383f29
commit 0083614a1a

View File

@ -89,7 +89,7 @@ users=$(users | wc -w)
swap_total=$(free -m | awk '/Swap/ { printf("%3.0f", $3/$2*100) }' | sed 's/ //g')
swap_usage=${swap_usage//[!0-9]/} # to remove alfanumeric if swap not used
swap_total=$(free -m | awk '/Swap/ {print $(2)}')
ip_address=$(hostname -I | tail -1)
ip_address=$(hostname -I | tr " " "\n" | grep -E "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" | tail -n2 | tr "\n" " ")
root_usage=$(df -h / | awk '/\// {print $(NF-1)}' | sed 's/%//g')
root_total=$(df -h / | awk '/\// {print $(NF-4)}')
if [ -e "$storage" ]; then