]> git.nbdom.net Git - nb.git/commitdiff
etc/profile.d/sys.sh
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Sun, 17 Feb 2019 21:53:44 +0000 (21:53 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Sun, 17 Feb 2019 21:53:44 +0000 (21:53 +0000)
etc/profile.d/sys.sh

index 47e87a15044cc0c680c64fbbfe7cfa8abfdd783b..925011ff1c45d7e995ff6ba8e17f10d2afae8b7d 100644 (file)
@@ -42,14 +42,15 @@ sys_arch() {
 sys_df() {
        df -k -l | tail -n +2 | while read -r -a i; do
                mount=${i[0]}
-               # On docker root / mount point is "none"
-               [ -e "$mount" -o "$mount" = "/" ] || continue
                used=${i[2]}
                free=${i[3]}
                pcent=${i[4]}
                pcent=${pcent//%/}
                dir=${i[5]}
 
+               # On docker root / mount point is "none"
+               [ -e "$mount" -o "$dir" = "/" ] || continue
+
 # NB 12.12.17          inodes=($(df -P -l "$dir" | tail -n +2))
 # NB 12.12.17          iused=${inodes[2]}
 # NB 12.12.17          ifree=${inodes[3]}