mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-27 11:29:36 +03:00
bf5efb5c66
The ability to use blanks is documented in zpool(8) and implemented in module/zcommon/zfs_namecheck.c:valid_char(). Signed-off-by: Lukas Wunner <lukas@wunner.de> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #3083
36 lines
532 B
Bash
Executable File
36 lines
532 B
Bash
Executable File
#!/bin/sh
|
|
|
|
_do_zpool_export() {
|
|
local ret=0
|
|
local final=$1
|
|
local force
|
|
local OLDIFS="$IFS"
|
|
local NEWLINE="
|
|
"
|
|
|
|
if [ "x$final" != "x" ]; then
|
|
force="-f"
|
|
fi
|
|
|
|
info "Exporting ZFS storage pools"
|
|
# Change IFS to allow for blanks in pool names.
|
|
IFS="$NEWLINE"
|
|
for fs in `zpool list -H -o name` ; do
|
|
zpool export $force "$fs" || ret=$?
|
|
done
|
|
IFS="$OLDIFS"
|
|
|
|
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
|