diff options
author | Andrzej Telszewski <atelszewski@gmail.com> | 2016-08-27 07:44:44 +0700 |
---|---|---|
committer | David Spencer <idlemoor@slackbuilds.org> | 2016-08-28 00:22:40 +0100 |
commit | 2e588826414a9f86ac104da719fad16412972ffd (patch) | |
tree | 640c24deef0015492c231c2db6fd8df30decd3c8 /system/qemu-guest-agent/rc.qemu-ga | |
parent | b3dcfa5a903d9aa34b70c1c807c668c9c0e91379 (diff) |
system/qemu-guest-agent: Added (QEMU Guest Agent daemon).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/qemu-guest-agent/rc.qemu-ga')
-rw-r--r-- | system/qemu-guest-agent/rc.qemu-ga | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/system/qemu-guest-agent/rc.qemu-ga b/system/qemu-guest-agent/rc.qemu-ga new file mode 100644 index 0000000000000..54043e90263a5 --- /dev/null +++ b/system/qemu-guest-agent/rc.qemu-ga @@ -0,0 +1,45 @@ +#!/bin/sh + +################################################################################ +qemu_ga_start() { +################################################################################ + if [ -n "$(pidof qemu-ga)" ]; then + echo "qemu-ga seems to be already running." + return + fi + + /usr/bin/qemu-ga -d +} + +################################################################################ +qemu_ga_stop() { +################################################################################ + if [ -z "$(pidof qemu-ga)" ]; then + echo -e "qemu-ga does not seem to be running." + return + fi + + kill $(pidof qemu-ga) +} + +################################################################################ +qemu_ga_restart() { +################################################################################ + qemu_ga_stop + sleep 1 + qemu_ga_start +} + +case "$1" in +'start') + qemu_ga_start + ;; +'stop') + qemu_ga_stop + ;; +'restart') + qemu_ga_restart + ;; +*) + echo "usage: $0 start|stop|restart" +esac |