xref: /freebsd/libexec/rc/rc.d/opensm (revision 6829dae12bb055451fa467da4589c43bd03b1e64)
1#!/bin/sh
2#
3# $FreeBSD$
4#
5
6# PROVIDE: opensm
7# BEFORE: netif
8# REQUIRE: FILESYSTEMS
9
10. /etc/rc.subr
11
12name="opensm"
13start_cmd="opensm_start"
14rcvar="opensm_enable"
15
16command=/usr/bin/opensm
17command_args="-B"
18
19opensm_start()
20{
21	for guid in `ibstat | grep "Port GUID" | cut -d ':' -f2`; do
22		[ -z "${rc_quiet}" ] && echo "Starting ${guid} opensm."
23		${command} ${command_args} -g ${guid} >> /dev/null
24	done
25}
26
27load_rc_config $name
28run_rc_command $*
29