aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2020-10-19 12:47:36 -0300
committerSilvio Rhatto <rhatto@riseup.net>2020-10-19 12:47:36 -0300
commit6d44c532eee291dd760626775d0780678f5f402e (patch)
tree02c71069156d77b6e89d898a9875177c031e275d
parent884a1ec6f38156ddae4c4f4bc2e7c09d8643daad (diff)
downloadkvmx-6d44c532eee291dd760626775d0780678f5f402e.tar.gz
kvmx-6d44c532eee291dd760626775d0780678f5f402e.tar.bz2
Fix: additional checks at startup_rsync_to_guest and poweroff_rsync_from_guest
-rwxr-xr-xkvmx16
1 files changed, 16 insertions, 0 deletions
diff --git a/kvmx b/kvmx
index 4f47403..3759502 100755
--- a/kvmx
+++ b/kvmx
@@ -748,10 +748,18 @@ function kvmx_up {
local item
IFS=","
for item in $startup_rsync_to_guest; do
+ if [ -z "$item" ]; then
+ continue
+ fi
+
local id="`echo $item | cut -d ':' -f 1`"
local startup_rsync_to_guest_orig="`echo $item | cut -d ':' -f 2`"
local startup_rsync_to_guest_dest="`echo $item | cut -d ':' -f 3`"
+ if [ -z "$id" ] || [ -z "$poweroff_rsync_to_guest_orig" ] || [ -z "$poweroff_rsync_to_guest_dest" ]; then
+ continue
+ fi
+
echo "Rsyncing to guest: $startup_rsync_to_guest ($id)..."
kvmx_rsync_to $startup_rsync_to_guest_orig $startup_rsync_to_guest_dest
@@ -1038,10 +1046,18 @@ function kvmx_poweroff {
local item
IFS=","
for item in $poweroff_rsync_from_guest; do
+ if [ -z "$item" ]; then
+ continue
+ fi
+
local id="`echo $item | cut -d ':' -f 1`"
local poweroff_rsync_from_guest_orig="`echo $item | cut -d ':' -f 2`"
local poweroff_rsync_from_guest_dest="`echo $item | cut -d ':' -f 3`"
+ if [ -z "$id" ] || [ -z "$poweroff_rsync_from_guest_orig" ] || [ -z "$poweroff_rsync_from_guest_dest" ]; then
+ continue
+ fi
+
echo "Rsyncing from guest: $poweroff_rsync_from_guest ($id)..."
kvmx_rsync_from $poweroff_rsync_from_guest_orig $poweroff_rsync_from_guest_dest