Hi, I need to run a command on my linux pc, by pressing a button on a html file stored in the pc, but accessing it with my android smartphone, connected to the same network.
to help understand better:
on the PC there is index.html, which looks like this:
running "python3 -m http.server 8000" I'm able to access the file from my android browser.
whenever I click the button, I need my pc to run a shell command (the cmd variable, for instance)
do you know how can I achieve this? thanks in advance!
PS: I don't need a remote shell, I'm looking for a way to run a command from an html file
to help understand better:
on the PC there is index.html, which looks like this:
HTML:
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<header></header>
<main>
<script type="text/javascript">
function execute()
{
var cmd = document.getElementsByName('cmd')[0].value;
// run cmd in remote linux machine
}
</script>
<form name="casellaTesto" method="post">
<input type="text" name="cmd" value="echo 'ciao'" size="50">
<input type="button" value="exec" onclick="execute()">
</form>
</main>
<footer></footer>
</body>
</html>
running "python3 -m http.server 8000" I'm able to access the file from my android browser.
whenever I click the button, I need my pc to run a shell command (the cmd variable, for instance)
do you know how can I achieve this? thanks in advance!
PS: I don't need a remote shell, I'm looking for a way to run a command from an html file