Shell Script to Unmount Multiple Hard Drives?

I have tested the solution provided here :

It wasn’t easy to me but I could create the Unmount.sh file as described, then I added the following action to the shortcut:

System.Exec(/home/osmc/Unmount.sh)

Unfortunately the first time I use the shortcut it doesn’t work, and the second time it makes OSMC crash.