[plug] Restarting ppp from a 'doze box
Andrew Barbara
andrew at mailerdirect.net
Thu Feb 6 22:56:10 WST 2003
There is a command in the Putty suite, i think its plink.exe, have a look
at the download page
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
This allows you to execute commands on a linux box from a windows pc, i
used this for a while before moving to Cable. Maybe just use wvdial and
get plink to run wvdial from the win box, should work fine... it did for
me!
Andrew
On 6 Feb 2003, Sacha Schlegel wrote:
> On Thu, 2003-02-06 at 19:55, Anthony Wilson wrote:
> > Hey guys,
> >
> > I've got a Windoze box set up behind my firewall for my girlfriend to use,
> > and I want to allow her to start / restart / stop the ppp connection on the
> > firewall box from her machine.
> >
> > Anyone got some suggestions as to how I can go about this? (It needs to be a
> > point, click, bash PC with rock kind of solution ;)
> >
>
> Hi I got the following solution:
>
> Main-Webpage (index.php) on the server with php which looks like:
>
> ---------------------------------------------------------
> <h2>Internet Connection</h2>
> <form method="post" action="index.php">
> <?
> if($shutdown == "shutdown"){
> exec("sudo /usr/bin/poff");
> }
> elseif ($connect == "connect"){
> exec("/usr/bin/pon myISP");
> echo "Connecting ....... please wait";
> }
>
> sleep(1);
>
> echo "Connection to Internet is :";
>
> $prog = "pppd";
> $id = exec("pidof $prog");
>
> if($id != ""){
> echo " up (connected). ";
> echo "<input type=\"submit\" name=\"shutdown\" value=\"shutdown\">";
> }
> else{
> echo " down (not connectd). ";
> echo "<input type=\"submit\" name=\"connect\" value=\"connect\"";
> }
>
> echo "<br><br><input type=\"submit\" name=\"refresh\"
> value=\"Refresh\"";
>
> ?>
>
> --------------------------------------------------------------
>
> Now you have to make sure the the webserver can call the program pon.
> I use sudo (some say its not very secure but i did not care).
>
> So I did setup sudo. I edited (with the visudo command) the file
> /etc/sudoers this way:
>
> ---------------------------------------------------------------
>
> # sudoers file.
> #
> # This file MUST be edited with the 'visudo' command as root.
> #
> # See the man page for details on how to write a sudoers file.
> #
> # Host alias specification
>
> Host_Alias OFFICE = 192.168.0.21
>
> # User alias specification
>
> User_Alias WEBSERVER = nobody
>
> # Cmnd alias specification
>
> Cmnd_Alias DIALIN = /usr/bin/pon '"myISP"'
> Cmnd_Alias OFFLINE = /usr/bin/poff
>
> # User privilege specification
>
> root ALL=(ALL) ALL
> WEBSERVER OFFICE= NOPASSWD: DIALIN, OFFLINE
>
> Defaults mailto=root at 192.168.0.21
>
> -----------------------------------------------------
>
> So anybody can connect and disconnect via this web interface. Even I
> connect this way now. It does not handle if your ISP is busy, then it
> says connected :( ah nevermind.
>
> Sacha
>
>
> > cheers,
> > Anthony
>
--
This message was sent with an unlicensed evaluation version of
Novell NetMail. Please see http://www.netmail.com/ for details.
More information about the plug
mailing list