Help - Search - Members - Calendar
Full Version: /etc/rc.d/rc.local [solved]
MandrivaUsers.org > Advanced Topics > Command Line, Kernel and Programming
Demon
Hi there!

How do I start lynx at system boot, but to close it again so it doesn't work in background?

I need to open a page with lynx at the system start, so I added this line in /etc/rc.d/rc.local:

CODE
lynx 'http://www.some_address.com'


This works, but then lynx stays working in background. How to close it after loading the link?

Thanks in advance


[moved from Software by spinynorman]
tyme
how long does the page have to stay open? if it just needs to open and then close, you could always just add killall lynx to startup. But this is kind of a dirty way to do whatever it is you're trying to do...perhaps if you explain what you are trying to do we can find a better way.
Demon
It just needs to open the page, and then to exit.

Edit: page loads very quickly...
Greg2
You could make a small bash script using sleep and pkill. Make the script executable and place it in /usr/local/bin. Then in your rc.local add /usr/local/bin/script-name.
Demon
QUOTE (Greg2 @ Jan 14 2008, 06:49 PM) *
You could make a small bash script using sleep and pkill. Make the script executable and place it in /usr/local/bin. Then in your rc.local add /usr/local/bin/script-name.

Nice idea! But how to do that? biggrin.gif (I'm quite familiar with shell scripting but never used "sleep" and "pkill" commands before...)
Demon
I've found a solution! It is incredible simple!

CODE
lynx -dump 'http://www.link...com...'
Greg2
I still don't know what you're trying to do. However you may want to take a look at this in a terminal
CODE
lynx -dump http://www.google.com/ | head -n 17
you are piping the dump through head, exiting lynx, and adjusting the line output with the '-n 17' for the first 17 lines, you can change that for your needs. Please see 'man head'.
Demon
Thanks, but there's no need for this.
Let me explain exactly:

I have set a web server on my computer. I'm using free co.nr domain for that (http://www.freedomain.co.nr). I have no statical IP address, but my IP changes every time I restart computer. Now, each time I want to update my IP for the domain I must visit a link (provided by freedomain.co.nr, which contains my username and password) to update my current IP. Then I can access my domain name (www.demon.co.nr). biggrin.gif

Now it updates automatically!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.