File target_status of Package lio-utils.9620

#!/bin/bash
#

TCM_CFS_DIR="/sys/kernel/config/target/core"
LIO_CFS_DIR="/sys/kernel/config/target/iscsi"


#########################################################################


function lio_version () {
	if [ ! -d ${LIO_CFS_DIR} ]; then
		exit 1
	fi

	lio_node --version
}

function lio_status () {
	if [ ! -d ${LIO_CFS_DIR} ]; then
		exit 1
	fi

	lio_node --listendpoints
}

function tcm_version () {
	if [ ! -d ${TCM_CFS_DIR} ]; then
		exit 1
	fi

	tcm_node --version
}

function tcm_status () {
	if [ ! -d ${TCM_CFS_DIR} ]; then
		exit 1
	fi

	echo "[---------------------------] TCM/ConfigFS Status [----------------------------]"
	tcm_node --listhbas

	echo ""
	echo "[---------------------------] LIO-Target Status [----------------------------]"
	lio_status

	echo ""
	tcm_version
	lio_version
}


tcm_status
openSUSE Build Service is sponsored by