Files
vtl-appliance/scripts/load-mhvtl.sh

48 lines
914 B
Bash
Executable File

#!/bin/bash
set -e
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
print_info() {
echo -e "${YELLOW}${NC} $1"
}
print_success() {
echo -e "${GREEN}${NC} $1"
}
print_error() {
echo -e "${RED}${NC} $1"
}
if [ "$EUID" -ne 0 ]; then
print_error "Please run as root or with sudo"
exit 1
fi
print_info "Loading mhvtl kernel modules..."
if lsmod | grep -q mhvtl; then
print_info "mhvtl modules already loaded"
else
if [ -f /lib/modules/$(uname -r)/kernel/drivers/scsi/mhvtl.ko ]; then
modprobe mhvtl
print_success "mhvtl kernel module loaded"
else
print_info "Kernel module not found, using userspace mode"
fi
fi
if [ -f /usr/bin/vtllibrary ]; then
print_success "mhvtl is ready"
echo ""
print_info "Start mhvtl daemon with: systemctl start mhvtl"
else
print_error "mhvtl binaries not found"
exit 1
fi