Index: /branches/releng-9.0/nanobsd/tools/image
===================================================================
--- /branches/releng-9.0/nanobsd/tools/image	(revision 10591)
+++ /branches/releng-9.0/nanobsd/tools/image	(revision 10592)
@@ -17,8 +17,9 @@
 #
 # Arguments:
-# build              - Build NanoBSD parts which are not build yet
-# build force kernel - Build NanoBSD and force rebuilding the kernel
-# build force world  - Build NanoBSD and force rebuilding world
-# rebuild            - Rebuild NanoBSD (aka force rebuilding all)
+# build                         - Build NanoBSD parts which are not build yet
+# build force kernel            - Build NanoBSD and force rebuilding the kernel
+# build force world             - Build NanoBSD and force rebuilding world
+# rebuild                       - Rebuild NanoBSD (aka force rebuilding all)
+# deploy on <node> [and reboot] - Deploy the image on node and reboot if needed
 EOF
 }
@@ -45,4 +46,38 @@
   FORCE_KERNEL="yes"
   FORCE_WORLD="yes"
+elif [ "$1" = "deploy" -a "$2" = "on" ]; then
+  if [ -z "$3" ]; then
+      echo "Argument Error - '$3'"; exit 128
+  fi
+  host=$3
+  do_reboot=false
+  if [ -n "$4" -o -n "$5" ]; then
+    if [ "$4" = "and" -a "$5" = "reboot" ]; then
+      do_reboot=true
+    else
+      echo "Argument Error - '$4 $5'"; exit 128
+    fi
+  fi
+ 
+  # Find object directory 
+  img=${OBJDIR}/_.disk.image
+
+  if [ ! -r "$img" ]; then
+    p_err Source $img does not exists
+    exit 1
+  fi
+
+  prompt_timeout=5
+  p_warn "Going to DEPLOY $img to $host"
+  $do_reboot && p_warn "AND will REBOOT the $host"
+  p_warn "Press CTRL+C in $prompt_timeout seconds to CANCEL"
+  sleep $prompt_timeout
+
+  ssh $host mount || exit 1
+  cat $img | ssh $host /tools/update || exit 1
+  if do_reboot; then
+    ssh $host reboot
+    exit 0
+  fi
 else
   echo "Argument Error - '$1'"; exit 128
