mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
helpers: ynh_remove_systemd_config: Also remove the systemd service from YunoHost.
Every app or almost will do that, because it doesn't make sense to remove the systemd config but not the associated yunohost configuration. This will clean up a bit the remove scripts.
This commit is contained in:
parent
c827877387
commit
51d26ae027
1 changed files with 5 additions and 1 deletions
|
@ -29,7 +29,7 @@ ynh_add_systemd_config() {
|
|||
systemctl daemon-reload
|
||||
}
|
||||
|
||||
# Remove the dedicated systemd config
|
||||
# Remove the dedicated systemd config, and if configured into YunoHost, removes the service.
|
||||
#
|
||||
# usage: ynh_remove_systemd_config [--service=service]
|
||||
# | arg: -s, --service= - Service name (optionnal, $app by default)
|
||||
|
@ -44,6 +44,10 @@ ynh_remove_systemd_config() {
|
|||
ynh_handle_getopts_args "$@"
|
||||
local service="${service:-$app}"
|
||||
|
||||
if ynh_exec_warn_less yunohost service status "$app" >/dev/null; then
|
||||
yunohost service remove "$app"
|
||||
fi
|
||||
|
||||
local finalsystemdconf="/etc/systemd/system/$service.service"
|
||||
if [ -e "$finalsystemdconf" ]; then
|
||||
ynh_systemd_action --service_name=$service --action=stop
|
||||
|
|
Loading…
Add table
Reference in a new issue