diff options
author | Ramón M. Gómez <ramongomez@us.es> | 2018-10-18 13:08:44 +0200 |
---|---|---|
committer | Ramón M. Gómez <ramongomez@us.es> | 2018-10-18 13:08:44 +0200 |
commit | 56742dbd725f91f3e6f373182cb0196c9aa02356 (patch) | |
tree | b7e0b1c4a12d84908ac33188ddb28989dfb2d121 | |
parent | 74210dfb8ef508d32dce2d81b64e463b3840cdaa (diff) |
#872: Solving a potential problem with downloads in some Vagrant files.
-rw-r--r-- | installer/vagrant/Vagrantfile-devel-vbox | 17 | ||||
-rw-r--r-- | installer/vagrant/Vagrantfile-prod-vbox | 17 |
2 files changed, 22 insertions, 12 deletions
diff --git a/installer/vagrant/Vagrantfile-devel-vbox b/installer/vagrant/Vagrantfile-devel-vbox index 00d7dab6..49bc655e 100644 --- a/installer/vagrant/Vagrantfile-devel-vbox +++ b/installer/vagrant/Vagrantfile-devel-vbox @@ -38,7 +38,12 @@ if [ -z "$(blkid /dev/mapper/og-images | grep ext4)" ]; then mount -a fi # Install OpenGnsys and change server address. -curl -s https://raw.githubusercontent.com/opengnsys/OpenGnsys/devel/installer/opengnsys_installer.sh | bash || exit $? +if which curl &>/dev/null; then + DOWNLOAD="curl -s" +elif which wget &>/dev/null; then + DOWNLOAD="wget -q -O -" +fi +$DOWNLOAD -s https://raw.githubusercontent.com/opengnsys/OpenGnsys/devel/installer/opengnsys_installer.sh | bash || exit $? mv /opt/opengnsys/log/bash.log /opt/opengnsys/log/opengnsys_installer.log echo y | /opt/opengnsys/bin/setserveraddr enp0s8 # Insert DHCP data. @@ -94,12 +99,12 @@ OGAGENTPKG = "ogagent_1.1.0_all.deb" MODELSCRIPT = <<EOT # Comment out next lines to install and configure OGAgent for Ubuntu. #apt-get update -y -#curl -ks https://#{SERVERIP}/opengnsys/descargas/#{OGAGENTPKG} -o #{OGAGENTPKG} -#if [ -f #{OGAGENTPKG} ]; then -# dpkg -i #{OGAGENTPKG} -# apt-get install -fy || exit $? +#apt-get install -y curl +#curl -ks https://#{SERVERIP}/opengnsys/descargas/#{OGAGENTPKG} -o /tmp/#{OGAGENTPKG} +#if [ -f /tmp/#{OGAGENTPKG} ]; then +# apt-get install -y /tmp/#{OGAGENTPKG} || exit $? # sed -i "0,/remote=/ s,remote=.*,remote=https://#{SERVERIP}/opengnsys/rest/," /usr/share/OGAgent/cfg/ogagent.cfg -# rm -f #{OGAGENTPKG} +# rm -f /tmp/#{OGAGENTPKG} #else # echo "Warning: cannot install OGAgent package #{OGAGENTPKG}" #fi diff --git a/installer/vagrant/Vagrantfile-prod-vbox b/installer/vagrant/Vagrantfile-prod-vbox index 813ee962..fa6f6ded 100644 --- a/installer/vagrant/Vagrantfile-prod-vbox +++ b/installer/vagrant/Vagrantfile-prod-vbox @@ -38,7 +38,12 @@ if [ -z "$(blkid /dev/mapper/og-images | grep ext4)" ]; then mount -a fi # Install OpenGnsys and change server address. -curl -s https://raw.githubusercontent.com/opengnsys/OpenGnsys/master/installer/opengnsys_installer.sh | bash || exit $? +if which curl &>/dev/null; then + DOWNLOAD="curl -s" +elif which wget &>/dev/null; then + DOWNLOAD="wget -q -O -" +fi +$DOWNLOAD -s https://raw.githubusercontent.com/opengnsys/OpenGnsys/master/installer/opengnsys_installer.sh | bash || exit $? mv /opt/opengnsys/log/bash.log /opt/opengnsys/log/opengnsys_installer.log echo y | /opt/opengnsys/bin/setserveraddr enp0s8 # Insert DHCP data. @@ -73,12 +78,12 @@ OGAGENTPKG = "ogagent_1.1.0_all.deb" MODELSCRIPT = <<EOT # Comment out next lines to install and configure OGAgent for Ubuntu. #apt-get update -y -#curl -ks https://#{SERVERIP}/opengnsys/descargas/#{OGAGENTPKG} -o #{OGAGENTPKG} -#if [ -f #{OGAGENTPKG} ]; then -# dpkg -i #{OGAGENTPKG} -# apt-get install -fy || exit $? +#apt-get install -y curl +#curl -ks https://#{SERVERIP}/opengnsys/descargas/#{OGAGENTPKG} -o /tmp/#{OGAGENTPKG} +#if [ -f /tmp/#{OGAGENTPKG} ]; then +# apt-get install -y /tmp/#{OGAGENTPKG} || exit $? # sed -i "0,/remote=/ s,remote=.*,remote=https://#{SERVERIP}/opengnsys/rest/," /usr/share/OGAgent/cfg/ogagent.cfg -# rm -f #{OGAGENTPKG} +# rm -f /tmp/#{OGAGENTPKG} #else # echo "Warning: cannot install OGAgent package #{OGAGENTPKG}" #fi |