#! /bin/sh
# This shuts down all switch ports quickly when the system reboots.
# This is only done on reboot, shutdown, halt, and poweroff, otherwise
# do nothing

# Invoked from the cumulus-fastfailover.service
systemctl list-jobs | egrep -q '(shutdown|reboot|halt|poweroff)\.target' || \
    exit 0

echo 1 > /cumulus/switchd/ctrl/shutdown_linkdown

exit 0
