LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-21-2004, 04:39 PM   #1
AbsoluteMonkey
Member
 
Registered: Mar 2004
Location: Boston
Distribution: Fedora Core 10
Posts: 58

Rep: Reputation: 15
Run script when interent logon


Hi, how would I run a script everytime the box connects to the net? I have a domain name and webhosting and want to be able to use the linux box as additional space. I need to linux box when it connects to the net (I'm using a DSL connection so the IP changes everytime it connects) to run a script that records the new IP in a db. The script I can handle, be a newbie I have no idea how to run the script whenver it connects. Thanks,
Travis
 
Old 03-21-2004, 05:27 PM   #2
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 47
What distro are you using?

Most distros have a set of scripts that run each time the network is started or stopped. You just need to add your script on the end of one of the standard network scripts.
 
Old 03-21-2004, 05:31 PM   #3
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 47
What you really need to do is get an account at dyndns.org. This is a free service that will allow you to have your computer's ip associated with one of their domain names. Even if your ip changes there are daemon scripts that will detect the change and automatically update dyndns.org so you never need to worry about your ip changing.
 
Old 03-22-2004, 09:22 AM   #4
AbsoluteMonkey
Member
 
Registered: Mar 2004
Location: Boston
Distribution: Fedora Core 10
Posts: 58

Original Poster
Rep: Reputation: 15
Yea, I looked into DynDNS but they have it free for their domains but charge for your own domain. If I can setup a script to do the similar I plan to have the pages that will be accessed on the box, be access thru a redirect on the site using the ip. Hope that makes sense.
I'm a complete newbie to linux. So I have no idea what a distro is.
 
Old 03-22-2004, 09:25 AM   #5
markehb
LQ Newbie
 
Registered: Mar 2004
Distribution: mandrake 9.0
Posts: 29

Rep: Reputation: 15
distro = distribution, be it mandrake 9.2 or redhat 6 or something.....
 
Old 03-22-2004, 10:43 AM   #6
AbsoluteMonkey
Member
 
Registered: Mar 2004
Location: Boston
Distribution: Fedora Core 10
Posts: 58

Original Poster
Rep: Reputation: 15
Oh yea, that makes sense. I used RedHat 9. I downloaded the discs from linux.com it says they are RedHat 9 Linux/i386. I tried getting swat but I don't know how to do that. When I installed the OS it asked if I wanted Samba. But never asked about SWAT and it's not listed in the services. I'm also using the GUI Gnome. Windows has corrupted me and I have a hard time configuring without the GUI.
Thanks
 
Old 03-22-2004, 03:07 PM   #7
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 47
Just put the script in /etc/sysconfig/network-scripts/ifup.d/. It will run each time one of your interfaces is activated.
 
  


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
Have scripts run when you logon BigChuckP Linux - Newbie 4 10-24-2005 07:41 PM
Run Shell Script on logon thesystem Debian 2 10-20-2005 11:11 AM
Samba as PDC: can it just run logon script, not host profiles? hamish Linux - Networking 0 09-09-2005 09:44 AM
Linux gateway - It doesn't allow run logon script of all clients to win2k3 b:z Linux - Networking 1 04-21-2005 11:17 PM
on Network Up Script run? On Battery power run script? v2-ncl Linux - General 0 12-08-2003 09:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:33 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration