1[Unit] 2Description=zpool scrub on %i 3Documentation=man:zpool-scrub(8) 4Requires=zfs.target 5After=zfs.target 6ConditionACPower=true 7ConditionPathIsDirectory=/sys/module/zfs 8 9[Service] 10ExecStart=/bin/sh -c '\ 11if @sbindir@/zpool status %i | grep "scrub in progress"; then\ 12exec @sbindir@/zpool wait -t scrub %i;\ 13else exec @sbindir@/zpool scrub -w %i; fi' 14ExecStop=-/bin/sh -c '@sbindir@/zpool scrub -p %i 2>/dev/null || true' 15