Activating a Script on Network Change

I needed to figure out how to launch a script to find the ip when the network was started and up on SuSE Linux. After doing some research I found out that you can add scripts to the ifup.d and ifdown.d folders.

I created a file a script

 
cd /etc/sysconfig/networking/scripts 
touch ifup.quickstart
vim ifup.quickstart 
# contents are below

Then I went ahead and added a symoblic link to /etc/sysconfig/networking/ifup.d

cd /etc/sysconfig/networking/ifup.d
ln -s /etc/sysconfig/networking/scripts/ifup.quickstart quickstart

Every time the interface is started up, it checks to see if the ip changed for the given hostname, and makes the modifications automatically.

This file is here is the one I created to do the edits to the hosts file.

Leave a Reply

Your email address will not be published. Required fields are marked *