File: export-zfs.sh.in

package info (click to toggle)
zfs-linux 2.3.3-1
  • links: PTS, VCS
  • area: contrib
  • in suites: forky, sid
  • size: 70,488 kB
  • sloc: ansic: 393,047; sh: 67,422; asm: 47,734; python: 8,160; makefile: 5,105; perl: 859; sed: 41
file content (22 lines) | stat: -rwxr-xr-x 384 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

_do_zpool_export() {
	info "ZFS: Exporting ZFS storage pools..."
	errs=$(zpool export -aF 2>&1)
	ret=$?
	echo "${errs}" | vwarn
	if [ "${ret}" -ne 0 ]; then
		info "ZFS: There was a problem exporting pools."
	fi

	if [ -n "$1" ]; then
		info "ZFS: pool list"
		zpool list 2>&1 | vinfo
	fi

	return "$ret"
}

if command -v zpool >/dev/null; then
	_do_zpool_export "${1}"
fi