aboutsummaryrefslogtreecommitdiff
path: root/kvmx
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2020-08-22 10:57:12 -0300
committerSilvio Rhatto <rhatto@riseup.net>2020-08-22 10:57:12 -0300
commit8fbdfc0f3aa2b41e8bc81e19e53cb4c09f606fb5 (patch)
tree86784c958c91d43bf2008b74d7a85ce5c224e08b /kvmx
parent7aa3b2baebe1b4b0e5a7233268df22bb0b71a851 (diff)
downloadkvmx-8fbdfc0f3aa2b41e8bc81e19e53cb4c09f606fb5.tar.gz
kvmx-8fbdfc0f3aa2b41e8bc81e19e53cb4c09f606fb5.tar.bz2
Feat: adds poweroff_pre_command, startup_rsync_to_guest and poweroff_rsync_from_guest
Diffstat (limited to 'kvmx')
-rwxr-xr-xkvmx17
1 files changed, 16 insertions, 1 deletions
diff --git a/kvmx b/kvmx
index 885ebec..a3edb7c 100755
--- a/kvmx
+++ b/kvmx
@@ -716,6 +716,11 @@ function kvmx_up {
echo "nohup $startup_command" | kvmx ssh $VM &> /dev/null &
fi
+ if [ ! -z "$startup_rsync_to_guest" ] && [ "$ssh_support" == "y" ]; then
+ echo "Rsyncing to guest: $startup_rsync_to_guest..."
+ kvmx_rsync_to $startup_rsync_to_guest
+ fi
+
kvmx_status
}
@@ -981,6 +986,16 @@ function kvmx_poweroff {
exit 1
fi
+ if [ ! -z "$poweroff_pre_command" ] && [ "$ssh_support" == "y" ]; then
+ echo "Running $poweroff_pre_command..."
+ echo "nohup $poweroff_pre_command" | kvmx ssh $VM &> /dev/null &
+ fi
+
+ if [ ! -z "$poweroff_rsync_from_guest" ] && [ "$ssh_support" == "y" ]; then
+ echo "Rsyncing to guest: $poweroff_rsync_from_guest..."
+ kvmx_rsync_to $poweroff_rsync_from_guest
+ fi
+
if [ "$run_xpra" == "1" ]; then
$DIRNAME/$BASENAME xpra $VM stop
fi
@@ -1132,7 +1147,7 @@ function kvmx_rsync_to {
rsync -av --delete -e "$SSH_COMMAND -o Port=$SSH" --rsync-path "sudo rsync" $ORIG/ 127.0.0.1:$DEST/
}
-# Rsync files to the guest
+# Rsync files from the guest
function kvmx_rsync_from {
if ! kvmx_running; then
echo "$BASENAME: guest $VM is not running"