Hide useless errors when waiting for zpool to be ready

This commit is contained in:
Andrew Dunham 2018-10-16 02:45:25 -07:00
parent 45a419ab5a
commit c3e004799c

View File

@ -74,7 +74,7 @@ let
importLib = {zpoolCmd, awkCmd, cfgZfs}: ''
poolReady() {
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
return 0
else