Display storage only if present

This commit is contained in:
Igor Pečovnik 2016-01-15 08:22:06 +01:00
parent 87f0958d58
commit 6e6cdf74dc

View File

@ -123,8 +123,8 @@ ip_address=$(ifconfig eth0 | sed -n '/inet addr/s/.*addr.\([^ ]*\) .*/\1/p')
root_usage=$(df -h / | awk '/\// {print $(NF-1)}' | sed 's/%//g')
root_total=$(df -h / | awk '/\// {print $(NF-4)}')
storage_usage=$(df -h $storage | awk '/\// {print $(NF-1)}' | sed 's/%//g')
storage_total=$(df -h $storage | awk '/\// {print $(NF-4)}')
storage_usage=$(df -h $storage | grep $storage | awk '/\// {print $(NF-1)}' | sed 's/%//g')
storage_total=$(df -h $storage | grep $storage | awk '/\// {print $(NF-4)}')
hdd_temp=$(hddtemp -u C -nq /dev/sda)
# read temperature from two different locations