From c322e317ccd7550337a622436db8e1e9bb48214c Mon Sep 17 00:00:00 2001
From: "Alan J. Pippin" <ajp@pippins.net>
Date: Thu, 28 Jan 2010 22:14:15 -0700
Subject: [PATCH] Added throttle option support

---
 zfs-restore | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/zfs-restore b/zfs-restore
index 71ed8bd..b3c809a 100755
--- a/zfs-restore
+++ b/zfs-restore
@@ -76,7 +76,11 @@ fi
 if [[ -n "$SCRIPT_UNDER_TEST" ]]; then
   echo "$zfs send -R $src_pool/$last_backup_marker | ssh $dst_hostname $zfs recv -dv $dst_pool"
 else 
-  $zfs send -R "$src_pool/$last_backup_marker" | ssh $dst_hostname "$zfs recv -dv $dst_pool"
+   if [[ $throttle_enable == 1 && -e $throttle ]]; then
+     $zfs send -R "$src_pool/$last_backup_marker" | $throttle $throttle_opt | ssh $dst_hostname "$zfs recv -dv $dst_pool"
+   else 
+     $zfs send -R "$src_pool/$last_backup_marker" | ssh $dst_hostname "$zfs recv -dv $dst_pool"
+   fi 
 fi
 
 # Now rename the dst filesystem (move it into place)
-- 
2.34.1