#!/bin/sh # preinst for madcat-caddy # # Stop existing caddy services before install/upgrade. # Guards against failures when services don't exist (e.g., caddy-api.service # from stock caddy may not be present on all systems). set -e if [ -d /run/systemd/system ]; then # Stop stock caddy services — both may not exist, so guard with || true systemctl stop caddy.service 2>/dev/null || true systemctl stop caddy-api.service 2>/dev/null || true fi