support de l'activation de services systemd uniquement
This commit is contained in:
parent
a76d28e9fd
commit
ce52d25855
|
@ -65,12 +65,21 @@ function pkg_check_install() {
|
|||
function service_disable() {
|
||||
# Désactiver le service $1 pour qu'il ne se lance pas automatiquement au
|
||||
# démarrage
|
||||
update-rc.d -f "$1" remove
|
||||
if [ -f "/etc/init.d/$1" ]; then
|
||||
update-rc.d -f "$1" remove
|
||||
elif [ -f "/etc/systemd/system/$1.service" ]; then
|
||||
systemctl disable "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
function service_enable() {
|
||||
# Activer le service $1 pour qu'il se lance automatiquement au démarrage
|
||||
update-rc.d "$1" defaults
|
||||
if [ -f "/etc/init.d/$1" ]; then
|
||||
update-rc.d "$1" defaults
|
||||
elif [ -f "/etc/systemd/system/$1.service" ]; then
|
||||
systemctl daemon-reload
|
||||
systemctl enable "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
################################################################################
|
||||
|
|
Loading…
Reference in New Issue