# 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]}
-# NB 12.12.17 ipcent=${inodes[4]}
-# NB 12.12.17 ipcent=${pcent//%/}
-# NB 12.12.17 idir=${inodes[5]}
-
echo -e "$dir\t$pcent\t$used\t$free"
- #echo -e "$dir\tused\t$used"
- #echo -e "$dir\tfree\t$free"
- #echo -e "$dir\tpcent\t$pcent"
done
}
# NB 13.05.19 awk '{printf("%.1f\n",$1/1000)}' /sys/class/thermal/thermal_zone*/temp
#awk '{ count++; sum+=$1 } END {printf("%.1f",sum/count/1000)}' /sys/class/thermal/thermal_zone*/temp
}
-
-sys_umount_dir() {
- sys_mount_dir --unmount $@
-}
-
-sys_mount_dir() {
- local usage="Usage: sys_mount_dir [--umount] DIR"
-
- local umount=0
- [ "$1" = "--unmount" ] && umount=1 && shift
-
- local dir=${1:?$usage}
- [ ! -d "$dir" ] && echo "$usage" && return 1
- local real_dir="$(cd "$dir" && pwd -P)"
- [ 0 = 1 \
- -o "$real_dir" = "/" \
- -o "$real_dir" = "$(pwd)" \
- ] && echo "Directory not allowed: $dir ( $real_dir )" && return 1
-
- for i in proc dev dev/pts dev/shm sys; do
- [ -d "/$i" -a -d "$dir/$i" ] || continue
-
- if [ "$umount" = "0" ]; then
- echo mount -v -o bind /$i $dir/$i
- else
- echo umount -v $dir/$i
- fi
- done
-}