#!/bin/sh
# postinst for node-app-{{name}} (scaffolded by node-app-build)
# Best-effort daemon notification. Exits 0 on any failure (FR-012).

set -e

# shellcheck disable=SC1083  # {{name}} is a node-app-build placeholder, replaced at scaffold time
case "$1" in
    configure)
        if [ -S /run/node/control.sock ] && command -v node-ctl >/dev/null 2>&1; then
            node-ctl app reload {{name}} 2>/dev/null || true
        fi
        ;;
    abort-upgrade|abort-remove|abort-deconfigure)
        ;;
esac

#DEBHELPER#
exit 0
