Jump to content

/etc/rc.d/rc.local [solved]


Recommended Posts

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:

 

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]

Edited by Demon
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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? :D (I'm quite familiar with shell scripting but never used "sleep" and "pkill" commands before...)

Link to comment
Share on other sites

I still don't know what you're trying to do. However you may want to take a look at this in a terminal

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'.

Link to comment
Share on other sites

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). :D

 

Now it updates automatically!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...