-checksystem()
-{
- /sbin/modinfo $ZFS_MODULE &>/dev/null
- if [[ $? -ne 0 ]]
- then
- eerror "$ZFS_MODULE not found. Is the ZFS package installed?"
- return 1
- fi
- if [[ ! -x $ZPOOL ]]
- then
- eerror "$ZPOOL binary not found."
- return 1
- fi
- if [[ ! -x $ZFS ]]
- then
- eerror "$ZFS binary not found."
- return 1
- fi
-
- # create the lockdir if not there
- lockdir=$(dirname ${LOCKFILE})
- if [[ ! -d ${lockdir} ]]
- then
- mkdir -p ${lockdir} &>/dev/null
+checksystem() {
+ if [ -c /dev/zfs ]; then
+ einfo "ZFS modules already loaded"
+ return 0
+ else
+ einfo "Checking if ZFS modules present"
+ if [ "x$(modprobe -l $ZFS_MODULE | grep $ZFS_MODULE)" == "x" ]; then
+ eerror "$ZFS_MODULE not found. Is the ZFS package installed?"
+ return 1
+ fi