SVC="llama.cpp.service" pre_upgrade() { systemctl is-active $SVC >/dev/null && \ systemctl stop $SVC || true } post_upgrade() { systemctl daemon-reload systemctl reset-failed $SVC 2>/dev/null || true systemctl is-enabled $SVC >/dev/null && \ systemctl start $SVC } pre_remove() { systemctl is-active $SVC >/dev/null && \ systemctl stop $SVC || true systemctl is-enabled $SVC >/dev/null && \ systemctl disable $SVC }