#!/bin/sh

cec_device="${CEC_DEVICE:-/dev/cec0}"
status=0

if [ -c "$cec_device" ]; then
    /usr/bin/cec-ctl --device "$cec_device" --to 0 --image-view-on >/dev/null || status=$?
else
    echo "cec-on: CEC device not found: $cec_device" >&2
    status=1
fi

/usr/bin/systemctl start signage.service || status=$?

exit "$status"
