You could simply create a bash script that does what you want, one line should do it, doesn’t even need to be executable, following DBMandrake…
umount /media/*
and then your python runscript becomes…
call(["/bin/bash", “/full/path-to/bash_script”])
though this will generate errors trying to unmount anything in /media/ that isn’t a mount point.
More elegantly your bash one-liner could be
df | grep “/media/” | cut -f1 -d ’ ’ | while read n; do umount $n; done
or Sam’s suggestion
for disk in $(ls /dev/sd*); do grep -q $disk /proc/mounts; if [ $? == 0]; then sudo umount $disk; fi; done
I would like to setup a custom menu shortcut to unmount the external USB Drive. I need that to deconnect the drive in order to use it on another computer that cannot access it through the network.
To do that I’m going to : Settings / Interface / Skin setup / Customize Home Menu.
There I would like to define a custom action, but I didn’t find anything that is working after trying the following :
I’m not a Linux user and I’m only using a Vero 4K and a Rii i25 remote (having a keyboard).
In case it is mandatory to create a python file, can someone advise a simple way to do that? Is there a Kodi AddOn to create and edit a python file from Kodi’s UI / File Manager?