Added configuration scripts to hold customized options
[zfs-nexenta/.git] / zfs-scrub
index 6488beb1aba222c80c5d29043e4700fd0ff8d6e5..939c798b4c6339e2e0523a39903b2f0e513afd55 100755 (executable)
--- a/zfs-scrub
+++ b/zfs-scrub
@@ -6,11 +6,15 @@
 #              running at any given time. This serializes the zfs 
 #              scrub process for any pool.
 
-PATH=/usr/sbin:/sbin:/etc/bin:$PATH
+# source our configuration
+config="${0%/*}/zfs-scripts.conf"
+[ -e "${config}.dist" ] && . ${config}.dist
+[ -e "${config}" ] && . ${config}
+
+exec >> $logdir/zfs-scrub.log 2>&1
 
 pools="$*"
 maxsleeptime=360
-mailto=root
 
 if [ -z "$pools" ]; then
    echo "-E- Usage: $0 <pools>"
@@ -59,7 +63,7 @@ do
   zpool status $i | grep scrub: | grep "with 0 errors" > /dev/null 2>&1
   if [ $? != 0 ]; then
     # The scrub found errors
-    zpool status $i | /usr/bin/mailx -s "zpool scrub $i found errors" $mailto 
+    zpool status $i | $mailx -s "zpool scrub $i found errors" $mailto 
   fi 
 
 done