#!/bin/sh /etc/rc.common
# Copyright (C) 2018 Sergey Sergeev adron@yapic.net

START=11

# Upstream's start() calls mtpoe-ctrl directly with no timeout. rc.common's
# init sequence is strictly sequential — if mtpoe-ctrl ever hangs talking to
# the PoE MCU over SPI (unverified hardware behavior, see CLAUDE.md's open
# questions on spidev node number and protocol), it blocks every later
# script forever, including dropbear and the full network bring-up. Hit
# exactly this live on trek.corp/RB5009UPr 2026-08-11: network came up fine
# (via preinit, which runs before this rc.d sequence), but nothing after
# this script ever started — no SSH, no HTTP, indefinitely.
#
# Bound it with a timeout so a hardware hang degrades to "PoE state not
# loaded this boot" instead of "device unreachable forever".
start() {
	timeout 5 /usr/bin/mtpoe-ctrl --action=load_poe_from_uci >/dev/null 2>&1
}
