Server IP : 37.60.233.201  /  Your IP : 216.73.216.198
Web Server : Apache
System : Linux host.ivahost.com 4.18.0-553.107.1.lve.el8.x86_64 #1 SMP Tue Feb 24 21:12:31 UTC 2026 x86_64
User : dcaksa ( 1043)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0555) :  /etc/ld.so.conf.d/../authselect/../init.d/../../cron.hourly/../alternatives/../../sbin/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //etc/ld.so.conf.d/../authselect/../init.d/../../cron.hourly/../alternatives/../../sbin/ibswitches
#!/bin/sh

IBPATH=${IBPATH:-/usr/sbin}

usage() {
	echo Usage: `basename $0` "[-h] [<topology-file> | -y mkey" \
	    "-C ca_name -P ca_port -t timeout_ms]"
	exit 255
}

topofile=""
ca_info=""
mkey="0"

while [ "$1" ]; do
	case $1 in
	-h | --help)
		usage
		;;
	-y | --m_key)
		case $2 in
		-*)
			usage
			;;
		esac
		if [ x$2 = x ] ; then
			usage
		fi
		shift
		mkey="$1"
		;;
	-P | --Port | -C | --Ca | -t | --timeout)
		case $2 in
		-*)
			usage
			;;
		esac
		if [ x$2 = x ] ; then
			usage
		fi
		ca_info="$ca_info $1 $2"
		shift
		;;
	-*)
		usage
		;;
	*)
		if [ "$topofile" ]; then
			usage
		fi
		topofile="$1"
		;;
	esac
	shift
done

if [ "$topofile" ]; then
	netcmd="cat $topofile"
else
	netcmd="$IBPATH/ibnetdiscover -y $mkey $ca_info"
fi

text="`eval $netcmd`"
rv=$?
echo "$text" | awk '
/^Switch/	{
			l=$0
			desc=substr(l, match(l, "#[ \t]*")+RLENGTH)
			pi=match(desc, "port 0.*")
			pinfo=substr(desc, pi)
			desc=substr(desc, 1, pi-2)
			type="base port 0"
			ti=match(desc, type)
			if (ti==0) {
				type="enhanced port 0"
				ti=match(desc, type)
				if (ti!=0)
					desc=substr(desc, 1, ti-2)
			} else
				desc=substr(desc, 1, ti-2)
			if (ti==0)
				print $1 "\t: 0x" substr($3, 4, 16) " ports " $2 " "\
					desc " " pinfo
			else
				print $1 "\t: 0x" substr($3, 4, 16) " ports " $2 " "\
					desc " " type " " pinfo}
/^ib/	{print $0; next}
/ibpanic:/	{print $0}
/ibwarn:/	{print $0}
/iberror:/	{print $0}
'
exit $rv