Running a shellscript from a custom menu?

I added a custom menu with two subitems, each runs a shellscript, ie:

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

where sideon.sh contains:
#!/bin/bash
sudo /home/osmc/a.out 1

When I run it from the menu, I just get a black screen. Script runs fine from ssh. Any ideas?

Edit: So System.exec is broken… And here I thought I could end my days without learning Python…

import subprocess
subprocess.call(['sudo', '/home/osmc/a.out', '1'])

Yes, I am lazy. will change name from a.out later :slight_smile:

System.Exec is indeed broken.

Apparently. Wish they would document that. Would have saved me some time.

https://kodi.wiki/view/List_of_built-in_functions

Tried using it myself and it stops every action of music or video player for a second. Pretty much unusable. Running my shell script through a short python script now using RunScript(). That’s working fine…

Well, here it hung the system completely.