0

I would like to call VLC from the command line (bash) through another computer's http request. In this case one computer will act as a server and will call different options to VLC based upon the http params it receives and the other computer will simply act as a client as it sends different http requests to the server with VLC on it.

This can be asked as a general question. Accept and http request on a server and subsequently call a CLI on bash.

1 Answer 1

1

The simplest way of doing is this is to set up a CGI script on Apache or any other web server, and use GET requests.

If something tries to fetch http://yourhost/cgi-bin/yourscript?doStuff, your script will be invoked, and $QUERY_STRING will contain doStuff:

#!/bin/bash
echo "Content-type: text/plain"
echo

if [[ $QUERY_STRING == doStuff ]]
then
    yourcommand --here
    echo "Thanks, your stuff is done. "
else
    echo "Unknown stuff to do. Here are my variables:"
    set
fi

Just be aware of which user your HTTP server runs your script as.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.