aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-03-10 10:19:22 -0300
committerSilvio Rhatto <rhatto@riseup.net>2017-03-10 10:19:22 -0300
commit203d80db1862160e3bf2609da56288c039d436a4 (patch)
treeb25ffe8ec157360b2ff12ae4bbe18cc6ab671de6
parent6a24bde9a781220a2cc091d2d0123612ea35cf0f (diff)
downloadkvmx-203d80db1862160e3bf2609da56288c039d436a4.tar.gz
kvmx-203d80db1862160e3bf2609da56288c039d436a4.tar.bz2
Adds reboot action
-rwxr-xr-xkvmx12
1 files changed, 12 insertions, 0 deletions
diff --git a/kvmx b/kvmx
index 8bbb55b..632a2a0 100755
--- a/kvmx
+++ b/kvmx
@@ -155,6 +155,18 @@ function kvmx_poweroff {
kvmx_status
}
+# Reboot the guest
+function kvmx_reboot {
+ if ! kvmx_running; then
+ echo "$BASENAME: guest $VM is not running"
+ exit 1
+ fi
+
+ echo /usr/bin/sudo reboot | kvmx_ssh &> /dev/null
+ sleep 3
+ kvmx_status
+}
+
# Rsync files to the guest
function kvmx_rsync {
if ! kvmx_running; then