Max2Play Home › Forums › Max2Play on ODROID U3/C1 › [SOLVED] Script for long button push
Tagged: U3 Scripts
- This topic has 2 replies, 2 voices, and was last updated 7 years, 11 months ago by
timmo11.
-
Posted in: Max2Play on ODROID U3/C1
-
3. Juli 2015 at 8:26 #15099
Hi
First of all – I think that Max2play is extremely good. It basically solves lots and lots of problems in one box.
I’m running on an odroid U3
I would like to write a small script to be called when the button is pushed for a long time.
There is a place to set this up in the „Odroid Advanced Features“ tab.The script only has to do one thing – get the LMS to rescan the library.
I wrote a trival shell script to do this called rescan and put it in /root which just contains the lines
#!/bin/bash
echo -e „rescan\nexit\n“ | nc localhost 9090 > /dev/null
exit 0and that works just fine from the linux command line
but adding it as $HOME/rescan as the script to call in U3 advanced settings when the button is pushed doesn’t seem to workso I am calling it the wrong way, or do I need to wrap it up into some other kind script package?
3. Juli 2015 at 9:31 #15101Hi timmo11,
if the complete path of the executable file is „/root/rescan“, than it should work by pasting this into the „Start my own Script“.
You might try to debug, if something is not working as expected: add some logging to the command in the webinterface to see what the command-line output is. In your case you might try this for the „Start my own Script“:
/root/rescan 2>&1 > /tmp/rescan-output
After pushing the button, there should be a file with the output of your script – to open it use „cat /tmp/rescan-output“
-
This reply was modified 7 years, 11 months ago by
flysurfer.
-
This reply was modified 7 years, 11 months ago by
-
You must be logged in to reply to this topic.