diff options
Diffstat (limited to 'src/utils/fs.py')
-rw-r--r-- | src/utils/fs.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/utils/fs.py b/src/utils/fs.py index a0c12d4..49da7ce 100644 --- a/src/utils/fs.py +++ b/src/utils/fs.py @@ -69,6 +69,15 @@ def umount(target): return not proc.returncode +def umount_all(): + """ + Umounts all mountpoints present in the /mnt folder. + """ + for path in ['/mnt/'+child for child in os.listdir('/mnt/')]: + if os.path.ismount(path): + umount(path) + + def get_usedperc(mountpoint): """ Returns percetage of used filesystem as decimal number. |