mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-27 11:29:36 +03:00
30 lines
413 B
Bash
30 lines
413 B
Bash
|
#!/bin/sh
|
||
|
|
||
|
_do_zpool_export() {
|
||
|
local ret=0
|
||
|
local final=$1
|
||
|
local force
|
||
|
|
||
|
if [ "x$final" != "x" ]; then
|
||
|
force="-f"
|
||
|
fi
|
||
|
|
||
|
info "Exporting ZFS storage pools"
|
||
|
zpool list -H | while read fs rest ; do
|
||
|
zpool export $force "$fs" || ret=$?
|
||
|
done
|
||
|
|
||
|
if [ "x$final" != "x" ]; then
|
||
|
info "zpool list"
|
||
|
zpool list 2>&1 | vinfo
|
||
|
fi
|
||
|
|
||
|
return $ret
|
||
|
}
|
||
|
|
||
|
if command -v zpool >/dev/null; then
|
||
|
_do_zpool_export $1
|
||
|
else
|
||
|
:
|
||
|
fi
|