Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I run Opensuse 12.2.

I have 3 network interfaces, eth[012]

The interfaces are configured in /etc/sysconfig/network/ifcfg-eth[012]

I want to execute a script immediately after ALL three interfaces are 'up'.

Adding

POST_UP_SCRIPT="/path/to/script.sh"

to ifcfg-eth[012] executes the script after any ONE interface is up.

Placing the script in

/etc/sysconfig/network/if-up.d/script.sh

executes the script multiple times - once after EACH interface is up.

How do I execute the script ONLY ONCE, immediately after the last interface is brought up?

share|improve this question

1 Answer 1

Why not try this. Assuming these scripts are run in sequence 0 -> 2 then you should be able to just run this script at the last postup of eth2. Else if you need more intelligence you will need to have some logic in your script, i.e. only executing once ethtool has reported all interfaces are up and running. It should be pretty easy adding such logic.

Cheers, Dexter

share|improve this answer
    
There's no guarantee that the scripts execute/finish in order. Where should "such logic" be added so that the target script executes only once? –  Dan A Nov 29 '12 at 15:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.