[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: execute command from HTML page



Matthias Hentges wrote:
Am Mon, 2002-11-11 um 00.06 schrieb Hugh Saunders:

hello, i have had major hassle attemting to use diald
[wvdial works fine but diald does not]
so, i want to create a simple html page to serve with apache so that machines on my network can click on one of two links
1: dialup -execute wvdial
2: hangup -kill pppd

is this possible to do simply?


Nope, not simply.

You'll have to write a CGI script which generates HTML-output with those
2 links and calls dialup / pppd. The user running the webserver
(www-data?) must have permission to run both tools.

If you want to keep it simple that it ;)

The CGI doesn't need to generate the HTML with the links, you can just have a static HTML page with links to the two CGI scripts. If you don't need any input/output this is pretty simple, they would simply be 2 scripts that called the required commands.

Actually you wouldn't even need the HTML at all, you could simply enter the address of the cgi script into your browser and load it to cause it to execute. Provided that apache and user permissions were set up correctly.

The other option of course is to work out the issues with diald - but obviously you are sick of trying that :) Or maybe setup dial-on-demand in ppp-config instead of using diald/wvdial? I seem to remember someone recently having diald problems use this method to good effect.

Barney.



Reply to: