Hide useless errors when waiting for zpool to be ready

wip/yesman
Andrew Dunham 6 years ago
parent 45a419ab5a
commit c3e004799c
  1. 2
      nixos/modules/tasks/filesystems/zfs.nix

@ -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

Loading…
Cancel
Save