File: export-zfs.sh.in

package info (click to toggle)
zfs-linux 2.2.7-2
  • links: PTS, VCS
  • area: contrib
  • in suites: sid
  • size: 68,188 kB
  • sloc: ansic: 381,514; sh: 64,247; asm: 47,661; python: 8,127; makefile: 4,991; perl: 831; sed: 41
file content (22 lines) | stat: -rwxr-xr-x 384 bytes parent folder | download | duplicates (5)
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