File: export-zfs.sh.in

package info (click to toggle)
zfs-linux 2.0.3-9%2Bdeb11u1
  • links: PTS, VCS
  • area: contrib
  • in suites: bullseye
  • size: 54,364 kB
  • sloc: ansic: 365,663; sh: 57,417; asm: 8,996; python: 8,652; makefile: 5,521; perl: 770; sed: 41; awk: 5
file content (30 lines) | stat: -rwxr-xr-x 480 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh

. /lib/dracut-zfs-lib.sh

_do_zpool_export() {
	ret=0
	errs=""
	final="${1}"

	info "ZFS: Exporting ZFS storage pools..."
	errs=$(export_all -F 2>&1)
	ret=$?
	[ -z "${errs}" ] || echo "${errs}" | vwarn
	if [ "x${ret}" != "x0" ]; then
		info "ZFS: There was a problem exporting pools."
	fi

	if [ "x${final}" != "x" ]; then
		info "ZFS: pool list"
		zpool list 2>&1 | vinfo
	fi

	return ${ret}
}

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