From bd529d974e46bb18e861da6df031f9ed52bb4ab2 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Wed, 25 Nov 2015 15:11:05 +0100 Subject: [PATCH] gh-24: get context.sh in EC2 instances --- base/usr/sbin/one-contextd | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/base/usr/sbin/one-contextd b/base/usr/sbin/one-contextd index 896b73f..ab71329 100755 --- a/base/usr/sbin/one-contextd +++ b/base/usr/sbin/one-contextd @@ -47,12 +47,13 @@ function start { execute_scripts umount /mnt - else - if type vmtoolsd ; then - vmtoolsd --cmd 'info-get guestinfo.opennebula.context' | openssl base64 -d > /tmp/context.sh - export_rc_vars /tmp/context.sh - fi - + elif type vmtoolsd ; then + vmtoolsd --cmd 'info-get guestinfo.opennebula.context' | \ + openssl base64 -d > /tmp/context.sh + export_rc_vars /tmp/context.sh + execute_scripts + elif curl -o /tmp/context.sh http://169.254.169.254/latest/user-data + export_rc_vars /tmp/context.sh execute_scripts fi }