summaryrefslogtreecommitdiff
path: root/sysutils/linux-megacli2/files/megacli.sh.in
blob: 51aa7aba9b292489a330bc654ccb669793a955df (plain) (blame)
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
#!/bin/sh

# check for root user
#
if [ `id -u` -ne 0 ]
then
	echo You must be root to run `basename $0`.
	exit 1
fi

if ! [ `sysctl -n compat.linux.osrelease` = "2.6.12" ]; then
	echo You need to set compat.linux.osrelease to 2.6.12 to run `basename $0`.
	exit 1
fi

if ! [ -d /usr/compat/linux/sys ]; then
	echo You need to mount linsysfs to run `basename $0`.
	exit 1
fi

# check for active mfi_linux.ko
#
if ! kldstat -q -m mfi_linux
then
	if kldload mfi_linux
	then
		echo 'mfi_linux module loaded.'
	else
		echo 'mfi_linux module failed to load.'
		exit 1
	fi
fi

exec %%PREFIX%%/libexec/MegaCli ${*}