1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-10 01:17:40 +03:00
one/share/scripts/context-packages/base/etc/one-context.d/99-execute-scripts
Javi Fontan 97eae56e60 bug #2128: datastore file scripts are not executed in context
init scripts execution is moved to an external one-context.d script.
Now there is a new context variable (INIT_SCRIPTS) with the list of
files to execute from context.
2013-06-14 12:09:09 +02:00

21 lines
297 B
Bash
Executable File

#!/bin/bash
MOUNT_DIR=/mnt
TMP_DIR=/tmp/one-context-tmp
if [ -z "$INIT_SCRIPTS" ]; then
if [ -f "$MOUNT_DIR/init.sh" ]; then
INIT_SCRIPTS=init.sh
fi
fi
mkdir -p $TMP_DIR
cd $MOUNT_DIR
for f in $INIT_SCRIPTS; do
cp $f $TMP_DIR
chmod +x $TMP_DIR/$f
$TMP_DIR/$f
done