#!/bin/sh /etc/rc.common
# Nomad honeypot decoy listener. Off by default; the API/CLI start it
# when decoy_enabled flips on. Passive detection needs no service (the
# watchdog tick handles it) — this unit is ONLY the decoy listeners.

START=95
USE_PROCD=1

start_service() {
    enabled="$(uci -q get nomad.honeypot.decoy_enabled)"
    [ "$enabled" = "1" ] || return 0
    procd_open_instance
    procd_set_param command /usr/bin/nomad honeypot honeypot-serve
    procd_set_param respawn
    procd_set_param stderr 1
    procd_close_instance
}
