xref: /freebsd/libexec/rc/rc.d/opensm (revision cab6a39d7b343596a5823e65c0f7b426551ec22d)
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