`mac` is not defined and also code is executed only in very corner situations ( you have `if` for `hwinfo`, so it execute only if hwinfo is non-hash value but not nil ).