]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blobdiff - bin/install_script.sh
Fix install script to take vd type discs
[perso/Immae/Projets/Puppet.git] / bin / install_script.sh
index 3a5900689b6f0b74947656103e3de593d14115d0..d9d3808fdbb8f7f9fbf0650c553c48f76288b322 100755 (executable)
@@ -1,5 +1,20 @@
 #!/bin/bash
 
+usage() {
+cat <<EOF
+  $0 [options]
+  --help,-h               This help
+  --vps vps_name          Name of the vps
+  --password password     Password of the vps (only useful in case of no reboot)
+  --reinstall-first       Start with reinstalling the vps
+  --host-user user        Use another user (default: root)
+  --no-reboot             Don't reboot
+  --no-reboot-start       Don't reboot to rescue at the beginning
+  --no-reboot-end         Don't reboot to normal at the end
+  --git-branch            Use another puppet branch (default: master)
+EOF
+}
+
 set -e
 
 host_user=root
@@ -35,6 +50,10 @@ while [ -n "$1" ]; do
       git_branch="$2"
       shift
       ;;
+    --help|-h)
+      usage
+      exit 0
+      ;;
   esac
 
   shift
@@ -97,7 +116,7 @@ tar -xzf "\$NAME"
 
 echo 'Server = http://archlinux.mirrors.ovh.net/archlinux/\$repo/os/\$arch' > /tmp/root.x86_64/etc/pacman.d/mirrorlist
 
-DEVICE_STR=\$(cat /proc/mounts | grep "/dev/sd.. /mnt/")
+DEVICE_STR=\$(cat /proc/mounts | grep "/dev/[sv]d.. /mnt/")
 DEVICE=\$(echo "\$DEVICE_STR" | cut -d' ' -f1)
 MOUNTPOINT=\$(echo "\$DEVICE_STR" | cut -d' ' -f2)
 
@@ -182,7 +201,7 @@ puppet apply --test \$CODE_PATH/manifests/site.pp
 EOF
 
 cat > $ARCH_HOST_PUPPET_CONFIGURATION_SCRIPT <<EOF
-DEVICE_STR=\$(cat /proc/mounts | grep "/dev/sd.. /mnt/")
+DEVICE_STR=\$(cat /proc/mounts | grep "/dev/[sv]d.. /mnt/")
 DEVICE=\$(echo "\$DEVICE_STR" | cut -d' ' -f1)
 MOUNTPOINT=\$(echo "\$DEVICE_STR" | cut -d' ' -f2)