Re: Script Test [OT]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



kwhiskerz wrote:
The problem is that both computers return hostname = localhost, so that won't work. IP address is not always possible, as the network might not be up, especially on the laptop.

How would I check the HWaddress (MAC)?

As ifconfig returns a whole list of things:

1.How can I isolate just 00:xx:xx:xx:xx:xx in order to make a comparision?
2.How do I make this comparison in bash? I guess this value must be a string?

Wrong approach (that means I don't know how to do it reliably).

Try this instead, it needs to be run as root:
  #!/bin/bash
  # get the root device
  rt_dev=$(df / | sed -n '2s/ .*//p'
  # get the UUID in a shell variable
  fsid=$(dumpe2fs -h $rt_dev | sed -n '/UUID:/s/.*: *//p')
  # now you can test it against one or more systems
  # if they NFS mount their root like dickless workstations
  # you have to test something else like /tmp


--
Bill Davidsen <davidsen@xxxxxxx>
  "We have more to fear from the bungling of the incompetent than from
the machinations of the wicked."  - from Slashdot

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux