Jump to content
Demon

/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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

It just needs to open the page, and then to exit.

 

Edit: page loads very quickly...

Edited by Demon

Share this post


Link to post
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.

Share this post


Link to post
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...)

Share this post


Link to post
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'.

Share this post


Link to post
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!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...