#!/bin/sh
########################################################################
# Begin qemu-ga
#
# Description : Start Qemu Guest Agent
#
# Author      : Tomek Wójcik <tomek@bthlabs.pl>
#
# Version     : ZiomekOS 26.9.26
#
########################################################################

### BEGIN INIT INFO
# Provides:            qemu-ga
# Required-Start:      $network
# Should-Start:        networkmanager wicd
# Required-Stop:       $network
# Should-Stop:         networkmanager wicd
# Default-Start:       2 3 4 5
# Default-Stop:        0 1 6
# Short-Description:   Qemu Guest Agent
# Description:         Qemu Guest Agent
# X-LFS-Provided-By:   ZiomekOS
### END INIT INFO

. /lib/lsb/init-functions

case "$1" in
   start)
      log_info_msg "Starting qemu-ga..."
      start_daemon /usr/bin/qemu-ga -l /var/log/qemu-ga.log -d
      evaluate_retval
      ;;

   stop)
      log_info_msg "Stopping qemu-ga..."
      killproc /usr/bin/qemu-ga
      evaluate_retval
      ;;

   restart)
      $0 stop
      sleep 1
      $0 start
      ;;

   status)
      statusproc /usr/bin/qemu-ga
      ;;

   *)
      echo "Usage: $0 {start|stop|restart|status}"
      exit 1
      ;;
esac

# End qemu-ga
