LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-02-2009, 09:53 PM   #1
GGlinux
LQ Newbie
 
Registered: Oct 2008
Posts: 28

Rep: Reputation: 15
Getting an Interface UP via a script


Hi All,

I would like to create a subinterface on my linux box only when running a certain software.

For example, when I start my chilli server,

eg #/usr/local/etc/init.d/chilli start

I would like eth1:2 to be brought up. So what I did was creata a file called chilli.run with the following

#!/bin/sh
ifconfig eth1 10.1.3.254/24
#end

Now how do I get the chilli service to call this chilli.run file? Or is there a better way?
 
Old 03-02-2009, 09:58 PM   #2
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,240
Blog Entries: 5

Rep: Reputation: 190Reputation: 190
so why not add into your chili.run file the command to start the service ? then you would run that file to start the service and bring up the subinterface

then create second file to shut the interface down and stop the service ?
 
Old 03-02-2009, 11:06 PM   #3
GGlinux
LQ Newbie
 
Registered: Oct 2008
Posts: 28

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by farslayer View Post
so why not add into your chili.run file the command to start the service ? then you would run that file to start the service and bring up the subinterface

then create second file to shut the interface down and stop the service ?
Just got it working as you suggested, thanks I think the long hours have dulled my brain
 
Old 03-03-2009, 08:49 AM   #4
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,240
Blog Entries: 5

Rep: Reputation: 190Reputation: 190
I know what you mean, sometimes when you are standing too close to a problem you can't see the simple solution in the wider picture

Glad you got it all sorted out
 
  


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
want to start script when wlan interface goes up nrsorte Linux - Wireless Networking 5 03-26-2007 08:24 AM
Script to monitor interface equinox Linux - Networking 1 12-03-2005 09:39 PM
Automatic script for shutting down interface RajaRC Linux - Networking 0 11-03-2004 12:23 AM
Web interface with a cgi script DirtyDan Programming 5 10-05-2004 08:58 AM
how to run script on event ppp0 interface going down ? qwijibow Linux - Networking 4 02-24-2004 07:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:11 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration