Project

General

Profile

« Previous | Next » 

Revision 323f378b

Added by Renato Botelho almost 7 years ago

Use all possible kenv variables to detect serial

View differences:

src/etc/inc/system.inc
2332 2332
			$serial = str_replace(":", "", $if_info['hwaddr']);
2333 2333
		}
2334 2334
	} else {
2335
		$_gb = exec('/bin/kenv smbios.system.serial 2>/dev/null', $output);
2336
		$serial = $output[0];
2335
		foreach (array('system', 'planar', 'chassis') as $key) {
2336
			unset($output);
2337
			$_gb = exec("/bin/kenv -q smbios.{$key}.serial",
2338
			    $output);
2339
			if (!empty($output[0]) && $output[0] != "0123456789") {
2340
				$serial = $output[0];
2341
				break;
2342
			}
2343
		}
2337 2344
	}
2338 2345

  
2339 2346
	$vm_guest = get_single_sysctl('kern.vm_guest');

Also available in: Unified diff