mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-12 20:55:31 +03:00
Hide useless errors when waiting for zpool to be ready
This commit is contained in:
parent
45a419ab5a
commit
c3e004799c
1 changed files with 1 additions and 1 deletions
|
@ -74,7 +74,7 @@ let
|
||||||
importLib = {zpoolCmd, awkCmd, cfgZfs}: ''
|
importLib = {zpoolCmd, awkCmd, cfgZfs}: ''
|
||||||
poolReady() {
|
poolReady() {
|
||||||
pool="$1"
|
pool="$1"
|
||||||
state="$("${zpoolCmd}" import | "${awkCmd}" "/pool: $pool/ { found = 1 }; /state:/ { if (found == 1) { print \$2; exit } }; END { if (found == 0) { print \"MISSING\" } }")"
|
state="$("${zpoolCmd}" import 2>/dev/null | "${awkCmd}" "/pool: $pool/ { found = 1 }; /state:/ { if (found == 1) { print \$2; exit } }; END { if (found == 0) { print \"MISSING\" } }")"
|
||||||
if [[ "$state" = "ONLINE" ]]; then
|
if [[ "$state" = "ONLINE" ]]; then
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue