#!/bin/sh
# A successful full repair can clear degraded boot state; unrelated commits
# to a partial running tree must not enable overwriting the saved intent.
if [ "$COMMIT_STATUS" = SUCCESS ] && [ -f /run/vyos/boot-config-status ] \
    && [ "$(cat /run/vyos/boot-config-status)" != 0 ]; then
    sudo -n COMMIT_STATUS=SUCCESS /usr/libexec/vyos/vyos-boot-recovery.py --after-commit
fi
