Skip to content

Commit

Permalink
Another try for showing IP
Browse files Browse the repository at this point in the history
  • Loading branch information
igorpecovnik committed Jun 9, 2016
1 parent 1aa8383 commit 0083614
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/update-motd.d/30-sysinfo
Expand Up @@ -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
Expand Down

0 comments on commit 0083614

Please sign in to comment.