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…
and then your python runscript becomes…
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’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?