#!/bin/bash

if [[ $hostonly ]]; then
    inst /etc/multipath.conf
fi

if ldd /sbin/multipath |grep -q lib64; then
    LIBDIR="/lib64"
else
    LIBDIR="/lib"
fi

for f in  \
    /sbin/dmsetup \
    /sbin/kpartx \
    /sbin/mpath_wait \
    /sbin/multipath  \
    /sbin/multipathd \
    /sbin/xdrgetuid \
    /sbin/xdrgetprio \
    /etc/xdrdevices.conf \
    $(ls $LIBDIR/libmultipath* $LIBDIR/multipath/*) \
    	;do
    inst $f
done

inst_hook pre-trigger 02 "$moddir/multipathd.sh"
inst_hook pre-pivot   02 "$moddir/multipathd-stop.sh"
inst_rules 40-multipath.rules

inst "$moddir/multipath-scan.sh" /sbin/multipath-scan
inst_rules "$moddir/14-multipath-scan.rules"
