#! /bin/bash

# Left-over network interfaces on the OpenVSwitch bridge after pod termination
ifaces=$(ovs-vsctl show | grep -oP "could not open network device\s*\Kveth[a-f0-9]+" | wc -l)
if [ $ifaces -gt 25 ]; then
    echo "Cleaning rogue interfaces ($ifaces) on $(hostname)"
    {{ ands_script_path }}/clean_rogue_interfaces.sh > /dev/null
fi