sonic-buildimage/dockers/docker-teamd/config.sh
Shuotian Cheng 27dae90726 [docker-teamd]: Clean /etc/teamd/ folder before adding new configurations (#451)
Signed-off-by: Shuotian Cheng <shuche@microsoft.com>
2017-03-28 15:49:48 -07:00

13 lines
386 B
Bash
Executable File

#!/bin/bash
mkdir -p /etc/teamd
rm -f /etc/teamd/*
for pc in `sonic-cfggen -m /etc/sonic/minigraph.xml -v "minigraph_portchannels.keys() | join(' ')"`; do
sonic-cfggen -m /etc/sonic/minigraph.xml -a '{"pc":"'$pc'"}' -t /usr/share/sonic/templates/teamd.j2 >/etc/teamd/$pc.conf
done
mkdir -p /var/sonic
echo "# Config files managed by sonic-config-engine" >/var/sonic/config_status