#!/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 "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