cherault 0 Posted September 2, 2019 Report Share Posted September 2, 2019 Dear all, I managed a web interface under Linux/Apache. This interface must start and stop some shell scripts, through HTML buttons. My goal is to use just only one HTML button to do 3 actions: 1- Stop a shell script 2- Open a new HTML page 3- Start a new shell script So, usually, I will drive it like this: <script language="javascript"> function button() { function1(); function2(); function3(); } </script> But my problem is what kind of Javascript function is able to start and stop a shell script ? I found various answer with PHP, but I don't want use it ! Just HTML/JAVASCRIPT. Can you please help me ? Thank you for your support and help. Best regards, Quote Link to post Share on other sites
Ingolme 1,019 Posted September 3, 2019 Report Share Posted September 3, 2019 Javascript does not have access to the shell. That would make it much too easy to hack into anybody's computer from a web browser. Quote Link to post Share on other sites
cherault 0 Posted September 3, 2019 Author Report Share Posted September 3, 2019 Thanks Ingolme, So I can't call a shell script from Javascript. But from PHP it is possible, so why not whith Javascript ? I don't understand why, but it's ok, I will find a solution. I don't want to use PHP. May be there is another solution. Regards, Quote Link to post Share on other sites
smus 1 Posted September 3, 2019 Report Share Posted September 3, 2019 Try using Server side JavaScript (node.js) Quote Link to post Share on other sites
cherault 0 Posted September 3, 2019 Author Report Share Posted September 3, 2019 Ok, thanks Smus. Is it possible to do that with node.js ? If yes how ? Regards, Quote Link to post Share on other sites
smus 1 Posted September 3, 2019 Report Share Posted September 3, 2019 4 hours ago, cherault said: Ok, thanks Smus. Is it possible to do that with node.js ? If yes how ? Regards, I am not really into Linux shell system, but if you don't want to use PHP, other server side languages might be the alternative Quote Link to post Share on other sites
justsomeguy 1,135 Posted September 3, 2019 Report Share Posted September 3, 2019 But from PHP it is possible, so why not whith Javascript ? Because one of them runs in the web browser, and one of them runs on the web server. The web browser does not have console access to the web server. Quote Link to post Share on other sites
Ingolme 1,019 Posted September 3, 2019 Report Share Posted September 3, 2019 For the record, PHP does not have access to the user's shell either. It only has access to the shell of the server that the website is running on. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.