obihann / archey-osx

An archey script clone for OS X
http://obihann.github.io/archey-osx/
GNU General Public License v2.0
341 stars 124 forks source link

Calculating disk usage - hangs for ~10 seconds #60

Open rm-hull opened 8 years ago

rm-hull commented 8 years ago

Hi,

I was experiencing some issues with archey hanging for approx 10 seconds. I added set -x to the start of the script to see where the problem was, and this line was the cause.

Actually the df command was the problem - I have a SSHFS mount point that had 'gone away': this causes df to timeout after 10 seconds.

Clearly I could unmount it and the problem goes away, but maybe adding a / argument to the df command would make it a bit more robust, and then there's no need for the head -2 either.

e.g.

-disk=$(df | head -2 | tail -1 | awk '{print $5}')
+disk=$(df / | tail -1 | awk '{print $5}')

Happy to provide a PR if that suits?