aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xkvmx19
1 files changed, 15 insertions, 4 deletions
diff --git a/kvmx b/kvmx
index 5720848..cee2c76 100755
--- a/kvmx
+++ b/kvmx
@@ -873,14 +873,25 @@ function kvmx_provision {
exit 1
fi
+ echo "Syncing provision files into the guest..."
+
+ # Always sync default provisioners
+ SSH="`cat $SSHFILE`"
+ ORIG="$KVMX_BASE/share/provision/"
+ DEST="/usr/local/share/kvmx/provision/"
+
+ echo "sudo mkdir -p `dirname $DEST`" | kvmx_ssh
+ rsync -av -e "$SSH_COMMAND -o Port=$SSH" $provision_rsync_opts --rsync-path "sudo rsync" $ORIG/ 127.0.0.1:$DEST/
+
if [ ! -z "$provision_rsync" ]; then
- SSH="`cat $SSHFILE`"
ORIG="`echo $provision_rsync | cut -d ' ' -f 1`"
DEST="`echo $provision_rsync | cut -d ' ' -f 2`"
- echo "Syncing provision files into the guest..."
- echo "sudo mkdir -p `dirname $DEST`" | kvmx_ssh
- rsync -av -e "$SSH_COMMAND -o Port=$SSH" $provision_rsync_opts --rsync-path "sudo rsync" $ORIG/ 127.0.0.1:$DEST/
+ # Sync custom provisioners
+ if [ "$ORIG" != "$KVMX_BASE/share/provision/" ] && [ "$DEST" != "/usr/local/share/kvmx/provision/" ]; then
+ echo "sudo mkdir -p `dirname $DEST`" | kvmx_ssh
+ rsync -av -e "$SSH_COMMAND -o Port=$SSH" $provision_rsync_opts --rsync-path "sudo rsync" $ORIG/ 127.0.0.1:$DEST/
+ fi
fi
echo "Running provision command inside the guest..."