Skip to content

Instantly share code, notes, and snippets.

@faxm0dem
Forked from nyerup/dell-setdisplay.pl
Created July 11, 2019 07:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save faxm0dem/e67af2982699415f7c69e28abd8c5541 to your computer and use it in GitHub Desktop.
Save faxm0dem/e67af2982699415f7c69e28abd8c5541 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl -w
#
# Jesper Nyerup <nyerup@one.com>
my $ipmitool = '/usr/bin/ipmitool';
my @chararray = split(//, join(' ', @ARGV));
usage() if (@chararray == 0 or @chararray > 14);
system("$ipmitool raw 0x6 0x58 193 0x0 0x0 ".
sprintf('0x%x ', scalar(@chararray)).
join(' ', map { sprintf('0x%x', ord($_)) } @chararray));
system("$ipmitool raw 0x6 0x58 0xc2 0x0 0x0 ".
"0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0");
sub usage {
print <<EOF;
Usage: $0 <string>
Max. 14 characters
EOF
exit 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment