summaryrefslogtreecommitdiff
path: root/hpssacli-2.40-13.0_amd64.sh
blob: e736e792f482aedc14df34a2c2ca40a7a11194f7 (plain)
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
#!/bin/sh
[ "$(id -u)" = 0 ] || exec sudo -- $0 "$@"

deb=hpssacli-2.40-13.0_amd64.deb
deb=${0%.sh}.deb
url=https://downloads.linux.hpe.com/SDR/repo/mcp/pool/non-free/$deb

install_deb_url()
{
	local url="$1" deb pkg
	deb=${url##*/}
	pkg=${deb%%-*}

	if ! status=$(dpkg-query -W -f '${Status}' "$pkg") || ! [ "$status" = 'install ok installed' ]
	then
		[ -e "$deb" ] || wget -c "$url" || curl -O "$url"
		dpkg -i "$deb"
	fi
}

set -e
install_deb_url "$url"
PATH=/opt/hp/hpssacli/bld:$PATH

hpssacli controller slot=0 show |
	grep 'HBA Mode Enabled: True' ||
	hpssacli controller slot=0 modify hbamode=on
hpssacli rescan

# Thanks to rmp5s on unraid.net for the solution & link.
# Thanks to Daggr for confirming the solution.
#
# https://forums.unraid.net/topic/82007-solved-unraid-with-hp-p420i-raid-card-in-hp-proliant-dl380p-g8/