[SOLVED] Script for long button push

Max2Play Home Forums Max2Play on ODROID U3/C1 [SOLVED] Script for long button push

Tagged: 

Viewing 3 posts - 1 through 3 (of 3 total)
  • 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 0

    and 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 work

    so 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 #15101

    Hi 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 9 years, 5 months ago by flysurfer.
    4. Juli 2015 at 12:34 #15103

    hi fly

    thanks so much
    that did the trick

    now my workmates can bring their own music on a USB stick, press the button and off we go!

    thanks again

    TIm

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

Register here