summaryrefslogtreecommitdiffstats
path: root/installer/vagrant/Vagrantfile-devel-vbox
diff options
context:
space:
mode:
authorramon <ramongomez@us.es>2017-04-26 08:15:30 +0000
committerramon <ramongomez@us.es>2017-04-26 08:15:30 +0000
commitccec614da35b823a3b40bfb4a78805607546ab0e (patch)
tree825186e35da855bca404c5b1889b766c1df0e231 /installer/vagrant/Vagrantfile-devel-vbox
parent31d44a4eda13233baa77a9cf2847983dbadd674f (diff)
#739: Retocar fichero Vagrant para permitir reaprovisionamiento de servidor y solucionar problemas que pueden producirse durante una instalaciĆ³n previa de paquetes.
git-svn-id: https://opengnsys.es/svn/branches/version1.1@5279 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'installer/vagrant/Vagrantfile-devel-vbox')
-rw-r--r--installer/vagrant/Vagrantfile-devel-vbox18
1 files changed, 11 insertions, 7 deletions
diff --git a/installer/vagrant/Vagrantfile-devel-vbox b/installer/vagrant/Vagrantfile-devel-vbox
index 9cc70c56..e9a0f67a 100644
--- a/installer/vagrant/Vagrantfile-devel-vbox
+++ b/installer/vagrant/Vagrantfile-devel-vbox
@@ -22,13 +22,16 @@ LOCALWEBPORT = 8443
# OpenGnsys Server provisioning script: prepare repo disk, install OpenGnsys, change default interface, configure DHCP server.
OGSERVERSCRIPT = <<EOT
-# Mount repository disk.
-test -n "$(blkid /dev/sdb1 | grep ext4)" && exit
-echo -e "o\nn\np\n\n\n\nw" | fdisk /dev/sdb
-mkfs -t ext4 /dev/sdb1
-mkdir -p /opt/opengnsys/images
-echo "/dev/sdb1 /opt/opengnsys/images ext4 defaults 0 0" >> /etc/fstab
-mount -a
+# Exit if OpenGnsys is installed.
+[ -f /opt/opengnsys/doc/VERSION.txt ] && echo "Cannot provision, OpenGnsys is already installed." && exit 1
+# Mount repository disk, if necesary.
+if [ -n "$(blkid /dev/sdb1 | grep ext4)" ]; then
+ echo -e "o\nn\np\n\n\n\nw" | fdisk /dev/sdb
+ mkfs -t ext4 /dev/sdb1
+ mkdir -p /opt/opengnsys/images
+ echo "/dev/sdb1 /opt/opengnsys/images ext4 defaults 0 0" >> /etc/fstab
+ mount -a
+fi
# Install OpenGnsys and change server address.
wget -q http://opengnsys.es/svn/branches/version1.1/installer/opengnsys_installer.sh -O - | bash || exit $?
mv /opt/opengnsys/log/bash.log /opt/opengnsys/log/opengnsys_installer.log
@@ -78,6 +81,7 @@ dpkg-reconfigure -fnoninteractive console-setup
echo "Notes:"
echo "- OpenGnsys Server URL: https://localhost:#{LOCALWEBPORT}/opengnsys/"
[ -d /opt/opengnsys/www/angular ] && echo "- Angular-based web URL: https://localhost:#{LOCALWEBPORT}/opengnsys/angular/ogWebAdmin/"
+exit 0
EOT
# Client 1 OS provisioning script.