#!/usr/bin/perl -w use strict; use PowerEdge::RAC qw(prompt); my $ip = prompt('Enter the RAC card\'s IP address : ','192.168.1.122'); my $server = new PowerEdge::RAC(host => $ip); $| = 1; print "Printing system information as stored in the RAC\n"; print $server->sysinfo(); if ($server->is_powered_on()) { warn "\nPowering OFF the server with RAC at $ip now !\n"; warn "Press Ctrl-c within five seconds to abort\n"; for (1..5) { print "."; sleep 1; }; print " ", $server->power_off(), "\n"; print "Waiting for system to come down\n"; while($server->is_powered_on()) { print "."; sleep 1; }; print " system powered off\n"; print $server->post_log(); } else { print "\nSystem already powered off\n"; }; print "\nDone.\n";