LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 10-26-2007, 06:07 PM   #1
des_a
Member
 
Registered: Sep 2006
Posts: 254

Rep: Reputation: 18
Some Way to Execute a CGI Command Automatically


I've got a Buffalo WLI-TX4-G54HP. I love it, because it is a good way to allow myself to connect to the Internet. The only problem is that sometimes it disconnects and the easiest way to restore it is to reboot it.

It does so less when we connect it to the WRT300N router as opposed to the NETGEAR WGR614. However, a every once in a while it still does so.

I'm looking for a way to automate this procedure somehow. The desired target would be using a script for Linux. I can directly tell it via http:// to reboot with this URL: http://1.1.1.3/advance/apply.cgi?action=Reboot

This can be done using a browser, such as firefox or konqueror, or that one netscape like browser.

I'd like to automate the thing using a shell script. It should connect, using a command line browser of some sort, or a direct way to run the URL somehow. I'm not sure how to do this.

Second, even linking there requires a user name and password. I'll not give it away, however, I'd like it to enter them somehow by itself, as if it was me. How do I do this?
 
Old 10-26-2007, 06:18 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,965
Blog Entries: 11

Rep: Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865
If the device uses cookies, and you're asked to authenticate,
you should be able to drive it with lynx and/or wget ...

I don't have a set-up similar to yours, so can't give you a
ready to use script. But I've done automation with both
tools for other purposes - e.g. to check whether a specific
web-service is still up and running ...



Cheers,
Tink
 
Old 10-27-2007, 05:16 PM   #3
des_a
Member
 
Registered: Sep 2006
Posts: 254

Original Poster
Rep: Reputation: 18
Thanks. Knowing which programs I might be able to use helps a lot. I don't know if it uses cookies or not. What I do know, is only that it does ask for a username or password, and somehow it "knows" whether I've entered it while the current window is opened or not. Somehow it works that way. However, I wouldn't want to keep a window opened all the time, so I need to automate it based off of something else. This should tell me what to look into next. Thanks!
 
Old 10-27-2007, 06:18 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,965
Blog Entries: 11

Rep: Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865
Cool. Should you run into questions on either of those that you
can't resolve reading their man-pages come back and give's a holler ;}



Cheers,
Tink
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to automatically execute a command (TrueCrypt) on mount cbonar Linux - General 2 08-27-2006 10:42 AM
is it possible to automatically execute a command when cd is mounted? LiquidSlumber Linux - Software 1 03-26-2006 01:18 AM
Execute a windows command from inside a c-cgi-script leamassiot General 51 02-09-2006 10:06 AM
? to add a command to execute automatically when xwindows loads up Kasperisa Linux - Newbie 2 08-02-2003 10:16 AM


All times are GMT -5. The time now is 09:55 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration