nutools/lib/init.d/kvm-stop-all

39 lines
876 B
Bash
Executable File

#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
### BEGIN INIT INFO
# Provides: kvm-stop-all
# Required-Start:
# Required-Stop:
# Should-Start:
# Should-Stop: libvirt kvm $remote_fs $network $syslog $named
# Default-Start:
# Default-Stop: 0 1 6
# X-Interactive: true
# Short-Description: stops kvm virtual machines
# Description: stops kvm virtual machines
### END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin:@@dest@@
VIRSH_DEFAULT_CONNECT_URI=qemu:///system
LANG=fr_FR.UTF-8
UTOOLS_NO_COLORS=1
export PATH VIRSH_DEFAULT_CONNECT_URI LANG UTOOLS_NO_COLORS
. /lib/lsb/init-functions
case "$1" in
start)
;;
stop)
log_action_msg "Stopping kvm virtual machines..."
SKvm --stop-all
log_end_msg 0
;;
*)
log_action_msg "Usage: /etc/init.d/$NAME {start|stop}"
exit 1
;;
esac
exit 0