gh-37: send first parameter to scripts

Will be used by reconfiguration
pull/38/head
Javi Fontan 9 years ago
parent 7daed7cc1b
commit 7a95e9d044

@ -32,7 +32,7 @@ function export_rc_vars
function execute_scripts {
SCRIPTS_DIR="/etc/one-context.d"
for script in $SCRIPTS_DIR/*; do
$script
"$script" "$1"
done
}
@ -45,18 +45,20 @@ function start {
cp /mnt/context.sh /tmp/context.sh
fi
execute_scripts
execute_scripts "$1"
umount /mnt
elif curl -o /tmp/context.sh http://169.254.169.254/latest/user-data ; then
export_rc_vars /tmp/context.sh
execute_scripts
execute_scripts "$1"
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
execute_scripts "$1"
fi
}
start
COMMAND="$1"
start "$COMMAND"

Loading…
Cancel
Save