You are not logged in.
If I have several diskless clients, and I want to separate, say, which init.d scripts I want to run on any given machine is there a quick way I can start/stop scripts per machine. I want to run these scripts on these machines, but not those. I don't think I need a totally different installation from scratch to do that. I'm sure this is probably easy, but probably not used all that much. It could also be parsed from the kernel command line (possibly?) from an entry in the pxelinux.cfg that way to point each diskless client/group to use its' own rc.conf file? I want to be able to turn on certain machines to do certain tasks, but still be able to use the diskless for troubleshooting a sick machine in lieu of a live CD (since it would be quicker).
If there's a quick way to grab the MAC address by script or by writing a small C program, that will probably do it. I'm thinking that sed might also be a possibility.
I could start each machine with a minimal common init scripts in rc.conf and then login via SSH and start the different services on the designated machines, but I know there has to be a way to automate this process.
Last edited by nomorewindows (2012-01-30 17:09:03)
I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.
Offline
I searched around and found the following:
/sbin/ifconfig \
| grep 'eth0' \
| tr -s ' ' \
| cut -d ' ' -f5
the result it came up with was 'metric' which is another part of it, so I modified it to (shows all MAC):
ifconfig | grep "ether" | cut -b 15-31
Apparently this also works for a specific interface:
cat /sys/class/net/eth0/address
Now I just need to place it in my script with a conditional command to get it to execute based on the comparison.
Last edited by nomorewindows (2012-03-02 14:36:37)
I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.
Offline
I got it:
NET=`cat /sys/class/net/eth0/address | tr -d ':'`
if [$NET==<whatever>]; then <do whatever>; fi
Thought this was going to be more difficult, microsoft wouldn't make it this easy.
I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.
Offline