2 # shellcheck disable=SC2154
3 # resilver_finish-start-scrub.sh
4 # Run a scrub after a resilver
8 # 2: Script wasn't enabled in zed.rc
9 # 3: Scrubs are automatically started for sequential resilvers
10 [ -f "${ZED_ZEDLET_DIR}/zed.rc" ] && .
"${ZED_ZEDLET_DIR}/zed.rc"
11 .
"${ZED_ZEDLET_DIR}/zed-functions.sh"
13 [ "${ZED_SCRUB_AFTER_RESILVER}" = "1" ] ||
exit 2
14 [ "${ZEVENT_RESILVER_TYPE}" != "sequential" ] ||
exit 3
15 [ -n "${ZEVENT_POOL}" ] ||
exit 1
16 [ -n "${ZEVENT_SUBCLASS}" ] ||
exit 1
17 zed_check_cmd
"${ZPOOL}" ||
exit 1
19 zed_log_msg
"Starting scrub after resilver on ${ZEVENT_POOL}"
20 "${ZPOOL}" scrub
"${ZEVENT_POOL}"