]> gitweb.fluxo.info Git - hydra.git/commitdiff
Provision: interactivity config parameter
authorSilvio Rhatto <rhatto@riseup.net>
Wed, 30 Jan 2013 21:18:10 +0000 (19:18 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Wed, 30 Jan 2013 21:18:10 +0000 (19:18 -0200)
share/hydractl/provision

index 2477fa39274ba73be7d73603da66f96ecb61c6de..30a1ddcdcc810b4134bfd2a127465fed808569bc 100755 (executable)
@@ -77,6 +77,7 @@ function hydra_provision_create_volume {
 
 # Make sure there is provision config.
 function hydra_provision_config {
+  hydra_user_config interactive y "Interactive mode? (y/n)"
   hydra_user_config device /dev/sdb "Destination device"
   hydra_user_config root_size 20G "Size of root partition"
   hydra_user_config swap_size 2000 "Swap size (in MB, 0 to not create it)"
@@ -105,7 +106,7 @@ if [ ! -z "$1" ]; then
   fi
 fi
 
-# Get parameters
+# Get config parameters.
 hydra_provision_config
 
 # Check for requirements.
@@ -114,11 +115,11 @@ for req in debootstrap cryptsetup grub-pc lvm2 parted; do
 done
 
 # Warning.
-cat <<-EOF
-WARNING: about to partition $device!
-Press ENTER to continue, Ctrl-C to abort."
-EOF
-read answer
+if [ "$interactive" == "y" ]; then
+  echo "WARNING: about to partition $device!"
+  echo "Press ENTER to continue, Ctrl-C to abort."
+  read answer
+fi
 
 # Disk partitioning.
 if [ "$swap" != "0" ]; then