#!/usr/bin/perl -w use strict; use PowerEdge::RAC qw(prompt); my ($host, $user, $pass, $ip, $dir) = ('') x 5; print 'Example script to update the firmware on a RAC card.'. "\n"; $host = prompt('Enter the RAC card\'s IP address : ','192.168.1.120'); $user = prompt('Enter the RAC username : ', 'root'); $pass = prompt('Enter the RAC password : ', 'calvin'); $user ||= 'root'; $pass ||= 'calvin'; my $server = new PowerEdge::RAC( host => $host, user => $user, password => $pass, ); my ($def_ip, $def_dir); print 'Getting defaults from the RAC ...'."\n"; my $c = $server->config('TFTP_ADDR_FIRMWARE', 'TFTP_FIRMWARE_FILE'); $def_ip = $c->{'TFTP_ADDR_FIRMWARE'} || '192.168.1.1'; $def_dir = $c->{'TFTP_FIRMWARE_FILE'} || '/a00v22/'; $ip = prompt('Enter the TFTP server\'s IP : ', $def_ip); $dir = prompt('Enter the directory on the TFTP server : ', $def_dir); my $h = $server->sysinfo('Host Name') || 'not set'; warn "\nStarting RAC firmware update on $host (name: $h) now!\n"; warn "Press Ctrl-c within five seconds to abort\n"; $| = 1; for (1..5) { print "."; sleep 1; }; print "\n". 'Updating firmware'. "\n"; print 'Transfering image ..'; my $r = $server->fwupdate($ip, $dir); print 'Done.'. "\n";