Mise à jour de 'update-motd.d/sysinfo.py'
This commit is contained in:
parent
c30b7d8596
commit
2f173f845d
|
@ -41,6 +41,7 @@ def proc_mount():
|
|||
for m in open('/proc/mounts').readlines():
|
||||
a = m.split()
|
||||
if a[0].find('/dev/') is 0:
|
||||
if a[0].find('/dev/') is 0:
|
||||
statfs = os.statvfs(a[1])
|
||||
perc = 100-100.*statfs.f_bavail/statfs.f_blocks
|
||||
gb = statfs.f_bsize*statfs.f_blocks/1024./1024/1024
|
||||
|
@ -52,10 +53,12 @@ def inode_proc_mount():
|
|||
for m in open('/proc/mounts').readlines():
|
||||
a = m.split()
|
||||
if a[0].find('/dev/') is 0:
|
||||
statfs = os.statvfs(a[1])
|
||||
perc = 100-100.*statfs.f_ffree/statfs.f_files
|
||||
iTotal = statfs.f_files
|
||||
items[a[1]] = "%.1f%% of %.2d" % (perc, iTotal)
|
||||
# In case of vfat (raspberry) boot
|
||||
if a[1] != "/boot":
|
||||
statfs = os.statvfs(a[1])
|
||||
perc = 100-100.*statfs.f_ffree/statfs.f_files
|
||||
iTotal = statfs.f_files
|
||||
items[a[1]] = "%.1f%% of %.2d" % (perc, iTotal)
|
||||
return items
|
||||
|
||||
loadav = float(open("/proc/loadavg").read().split()[1])
|
||||
|
|
Loading…
Reference in New Issue