#!/bin/sh
#
# $FreeBSD$
#

# PROVIDE: ix-syncmultipaths
# REQUIRE: middlewared FILESYSTEMS ix-syncdisks

. /etc/rc.subr

syncmultipaths()
{
	echo "Syncing multipaths..."
	/usr/local/bin/midclt call disk.multipath_sync > /dev/null
	if [ "$(/usr/local/bin/midclt call system.is_freenas)" = "False" ]; then
		checkyesno failover_enable || /usr/local/bin/midclt call enclosure.sync_zpool > /dev/null
	fi
}

name="ix_syncmultipaths"
start_cmd='syncmultipaths'
stop_cmd=''

load_rc_config $name
run_rc_command "$1"
