command at boot, before another script

1

This should be an easy question, but as a solaris novice, I'm stuck. I have to launch a change MAC address command at boot (i.e. ifconfig bge0 ether). If I do this at terminal, everything goes smooth. where should I put this little command to make it run at boot? I already know about init.d directory and symlinks at rcX.d directories, but I don't know what to put in it, as I never made a script.

il_maniscalco

Posted 2013-02-16T10:20:31.923

Reputation: 33

Answers

0

Assuming that it's Solaris 10 or earlier, you should be able to just add your ether mac to the entry in /etc/hostname.bge0.

ie:

myserver [8] more /etc/hostname.bge0 myserver ether <the_mac_you_want>

sleepyweasel

Posted 2013-02-16T10:20:31.923

Reputation: 101

0

Check if you can see an /etc/init.d/rc.local you can put it there, if not then go to:

cd /etc/init.d/rc3.d

Then create a simple file named : S99ether for example

In it:

#!/bin/sh
/sbin/ifconfig bge0 ether

Check to make sure that ifconfig is under /sbin. To check: type ifconfig

Then

chmod 755 S99ether

Try to run S99ether by hand if should execute the command.

user3163621

Posted 2013-02-16T10:20:31.923

Reputation: 9