Last active
July 12, 2020 22:50
-
-
Save FlorianHeigl/f67ee8837802a92c425b0b5c3f54f003 to your computer and use it in GitHub Desktop.
lcd management dell r730
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# put the system hostname in the service display without dell OEM tools etc. | |
# found via | |
# https://pcloadletter.co.uk/2010/06/14/set-custom-lcd-panel-text-on-poweredge-r710-servers/ | |
syntax() { | |
echo " | |
$0 - automatically set hostname on Dell server's status display | |
USAGE: | |
$0 (get|set) | |
" | |
exit 1 | |
} | |
isdellserver() { | |
type dmidecode 2>&1>/dev/null && type ipmitool 2>&1>/dev/null && | |
SYSINFO=$( dmidecode | grep -A4 "System Information" ) && | |
[[ $SYSINFO =~ Dell ]] && | |
[[ $SYSINFO =~ PowerEdge ]] && | |
return $? | |
} | |
access_lcd() { | |
case $1 in | |
get) | |
ipmitool delloem lcd info ;; | |
set) | |
ipmitool delloem lcd set mode userdefined "$( uname -n )" ;; | |
*) | |
syntax ;; | |
esac | |
} | |
main() { | |
if isdellserver ; then | |
access_lcd "$1" | |
fi | |
} | |
[ $# != 1 ] && syntax | |
main "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment