Hi,
Regular Kodi user, hadn’t realised I wasn’t registered in OSMC.
I am trying to run a bash function from System.Exec. Through all sorts of debugging I’ve simplified down to trying the following:
I have editted DialogButtonMenu.xml in confluence skin to change shutdown behaviour from Shutdown() to →
System.Exec(“/home/osmc/test.sh”)
Test.sh is executable and owned by osmc
Test.sh contains:
#!/bin/bash
echo Hello World > /home/osmc/test.txt
So all I am expecting is a file called test.txt to appear containing Hello World. This works fine if I call test.sh from a terminal.
On Kodi however I get no test.txt, the dialogbuttonmenu clears and I start getting artefacts on the home screen and eventually Kodi restarts. On the first restart I get a mix of odd activity like “Web Server failed” and usually a complete lock up, not responding to remote or keyboard, on a 2nd manual restart (from terminal) I get normal service back.
I have searched the forum for subjects relating to System.Exec and it seems all of those queries lead to people finding a way to achieve what they wanted without it (Usually writing their command in python and doing a Runscript).
Can someone confirm that System.Exec does actually work? And if there are any specific OSMC syntax requirements?
The paste below of the kodi.log when I try pressing the button. The relevant sections starts at 16:12:16 1266.265747 with the dialogbuttonmenu opening. It looks like it trys to open the file as an audio sink?! and then crashes out when it can’t?
http://paste.osmc.io/abodetijeh.vhdl
I hope this isn’t me just being a NOOB, but kind of also hope it’s not a bug either.
(If this gets resolved what I would actually like is to recognise a CEC status message coming in saying the the TV has gone to standby but instead of Kodi shutting down (like the CEC options allow) use that trigger to run a script which redirects the network interface from a remote server. I want the Pi to remain running when TV off, but to drop its SMB connection.)
Regards,
Ant