-
Notifications
You must be signed in to change notification settings - Fork 5
/
dell-bios-dump.sh
55 lines (47 loc) · 1.21 KB
/
dell-bios-dump.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
#
# dell-bios.sh
#
# Dump the Dell BIOS configuration.
#
# Copyright (C) 2016 Nexenta Systems
# William Kettler <[email protected]>
#
ssh_racadm() {
#
# Remotely call racadm using ssh.
#
out=$(sshpass -p "$pass" ssh -o StrictHostKeyChecking=no "$host" "racadm $@" 2>&1)
# If sshpass fails best to exit immediately to avoid a hung iDRAC
if [ $? -ne 0 ]; then
echo "[FAILURE] sshpass"
echo "$out"
exit 1
fi
# We have no way of checking racadm return code so we must parse the output
# for an ERROR string
echo "$out" | grep -q ERROR
if [ $? -eq 0 ]; then
echo ""
echo "[FAILURE] $@"
else
echo ""
echo "[SUCCESS] $@"
fi
echo "-----"
echo "$out"
}
# Check command line parameters
if [ $# -ne 1 ]; then
echo Usage
echo -e "\t$0 [user@]host"
exit 1
fi
host=$1
# Prompt for password
read -s -p "Password :" pass
echo ""
settings=(BiosBootSettings IntegratedDevices MemSettings MiscSettings OneTimeBoot ProcSettings SataSettings SerialCommSettings SlotDisablement SysInformation SysProfileSettings SysSecurity TpmAdvanced)
for s in ${settings[@]}; do
ssh_racadm get BIOS.${s}
done