Heray-Was-Here
Server : Apache
System : Linux vps103298.mylogin.co 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User : calvet ( 273824)
PHP Version : 7.4.33
Disable Function : NONE
Directory :  /usr/share/fusioninventory/lib/FusionInventory/Agent/Task/Inventory/Linux/PowerPC/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/fusioninventory/lib/FusionInventory/Agent/Task/Inventory/Linux/PowerPC/Bios.pm
package FusionInventory::Agent::Task::Inventory::Linux::PowerPC::Bios;

use strict;
use warnings;

use parent 'FusionInventory::Agent::Task::Inventory::Module';

use FusionInventory::Agent::Tools;

sub isEnabled {
    return 1;
}

sub doInventory {
    my (%params) = @_;

    my $inventory = $params{inventory};

    my $bios;

    $bios->{SSN} = getFirstLine(file => '/proc/device-tree/serial-number');
    $bios->{SSN} =~ s/[^\,^\.^\w^\ ]//g; # I remove some unprintable char

    $bios->{SMODEL} = getFirstLine(file => '/proc/device-tree/model');
    $bios->{SMODEL} =~ s/[^\,^\.^\w^\ ]//g;

    my $colorCode = getFirstLine(file => '/proc/device-tree/color-code');
    my ($color) = unpack "h7" , $colorCode;
    $bios->{SMODEL} .= " color: $color" if $color;

    $bios->{BVERSION} =
        getFirstLine(file => '/proc/device-tree/openprom/model');
    $bios->{BVERSION} =~ s/[^\,^\.^\w^\ ]//g;

    my $copyright = getFirstLine(file => '/proc/device-tree/copyright');
    if ($copyright && $copyright =~ /Apple/) {
        # What about the Apple clone?
        $bios->{BMANUFACTURER} = "Apple Computer, Inc.";
        $bios->{SMANUFACTURER} = "Apple Computer, Inc.";
    }

    $inventory->setBios($bios);
}

1;

Hry