aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-09-08 13:00:56 -0300
committerSilvio Rhatto <rhatto@riseup.net>2017-09-08 13:00:56 -0300
commit1bad9e5728b59ef4fdd520552408b58701668c78 (patch)
treefd9d7e3bdf488d9ab9ff279030a00259e564f5a9
parentf94e41fecf2fea56fa65d1b57757e070569848c5 (diff)
downloadkvmx-1bad9e5728b59ef4fdd520552408b58701668c78.tar.gz
kvmx-1bad9e5728b59ef4fdd520552408b58701668c78.tar.bz2
Always sync default provisioners
-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..."