support de libvirt sur jessie

This commit is contained in:
Jephté Clain 2017-02-13 10:58:36 +04:00
parent fa3d3b48b1
commit feb00bcf11
1 changed files with 7 additions and 2 deletions

View File

@ -54,19 +54,24 @@ function ensure_kvm() {
[ -n "$modified" ] && sleep 1
service=
if check_sysinfos -d redhatlike; then
function __guess_service() {
for i in libvirtd libvirtd-bin; do
[ -f "/etc/init.d/$i" ] && {
service="$i"
break
}
done
}
if check_sysinfos -d redhatlike; then
__guess_service
elif check_sysinfos -d debian -v jessie+; then
__guess_service
elif check_sysinfos -d debianlike; then
service=libvirt-bin
fi
if [ -n "$service" ]; then
# s'assurer que le service tourne
service libvirt-bin startm
service "$service" startm
else
return 0
fi