Running a command on the Linux box from Win98

Here's the situation. I'm using a Linux box to IP masquerade for 2 Win98 PC's. The Linux box has got the modem attached to it to dial out to my ISP. I can start and stop the PPP connection fine from the Linux box.

Problem: My girlfriend is totally computer illiterate. Anything more than 'doubleclick' is a pain in the ass. How can I put an icon on her desktop so she can click on it to have the server dialin, and then another to shut it off? I've got samba set up, and my first thought was to make a script to do it, then realized... duh... doubleclick an icon on Win98, no matter WHERE it resides, and it runs on win98.

Another idea was to make a .dialup file, have cron run a script that searches for it, if it sees it, deletes it then dials in. Thats clunky, and she'd have to wait for up to 59 seconds for it to see that file and dial.

I know this is probably impossible simple, but I cant figure it out.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

There are 2 solutions that don't involve _any_ work for your girlfriend.

Kernel versions newer than 2.2.0 support demand dialing.
Start pppd with the "demand" option.  When network routing is requested, the ppp link will come up automatically.  It will shut itself down automatically after a specified idle time.  This works even for masqueraded traffic.

I have the following command in my /etc/rc.d/rc.local file:

/usr/sbin/pppd file /etc/ppp/manoptions

and in the manoptions file I specify (without comments)
/dev/modem 57600 crtscts  #adjust for your hardware
idle 900                  # in seconds    
holdoff 5

connect `/usr/sbin/chat -v -e -f /etc/ppp/chat-ut'
name rwenzla              
defaultroute  #Specify any valid IP pair
                               #for your ISP, needed only as
                               #starting point for next two

ipcp-accept-local              # These two options allow
ipcp-accept-remote             # pppd and your ISP
                               # to negotiate an IP pair.
lcp-echo-interval 60
lcp-echo-failure 3


If you have an older kernel and dont feel like upgrading, you could get diald (dial daemon), which does the above as a separate program.

edskeeAuthor Commented:
Hmm. Thats an option, however I dont want it dialing out when my pc boots up and MSN Messenger opens, or she opens internet explorer by mistake. Then she (I can shut it off) has to wait for the timeout for it to disconnect. If shes gotta make a phone call, that's not an option. (We only have 1 line, because this dialin ISP thing is only temporary)

Thanks for the info though. I'm gonna reject the answer for now, but will give you the points if I dont get a better solution for the problem.
If you know Perl or scripting then it should be simple to set up a service on the Linux box which listens on a particular socket, and when it gets a message, dials or disconnects the modem.

Your "icons" on win98 are simply other tiny Perl scripts that talk to the linux box.

Really, the scripts are so simple that even a computer-literate non-programmer could modify the ones at to do this.  

The only problem with sockets is that it's possible some hacker could probe you and connect to your chosen socket port (part of a port-scan)- the good news is that the worst they can do is disconnect you!

If you've got NFS or SAMBA file sharing, you could use a semaphore file and poll instead. This wouldn't even require Perl programming, just a simp[le shell script with a test for the file and a sleep.  But it's not _quite_ as elegant as listening on a socket.  

Either of these will work, although they're not particularly robust.  I'd probably go for the dialing on demand, but I'm buggered if I'm running MSN messenger.    All my internet apps stay disconnected until I tell them, that's for sure!


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
edskeeAuthor Commented:
I'm gonna go with the shell script/sleep idea. I dont like scrolling a process around every 5 seconds, but the perl script seems a bit... extreme. Maybe I'll write something in C lateron (I know nothing about perl) to do this, but for now a script that checks for .dial and .hangup every 5 seconds or so should be fine.

Thanks for the idea!
You don't need to wory about the port scan.  It's on the wrong side of the firewall.  It would have an unroutable local net address.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.