fix: do not run enable/disable when using init.d

init.d doesn't support these two commands, causing nginx:stop/nginx:start to fail.
This commit is contained in:
Jose Diaz-Gonzalez
2022-11-30 01:43:14 -05:00
parent a8bc8044e4
commit e2d215ab4f

View File

@@ -134,6 +134,8 @@ fn-nginx-vhosts-nginx-init-cmd() {
sudo /usr/bin/sv "$CMD" "$NGINX_INIT_NAME"
elif [[ -x /usr/bin/systemctl ]]; then
sudo /usr/bin/systemctl "$CMD" "$NGINX_INIT_NAME"
elif [[ "$CMD" == "enable" ]] || [[ "$CMD" == "disable" ]]; then
dokku_log_warn "Running $CMD is not possible for init.d managed services"
else
sudo "/etc/init.d/$NGINX_INIT_NAME" "$CMD"
fi