2019-05-09 01:00:49 -05:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
mkdir -p /etc/frr
|
|
|
|
|
|
|
|
CONFIG_TYPE=`sonic-cfggen -d -v 'DEVICE_METADATA["localhost"]["docker_routing_config_mode"]'`
|
|
|
|
|
|
|
|
if [ -z "$CONFIG_TYPE" ] || [ "$CONFIG_TYPE" == "separated" ]; then
|
2019-11-06 18:07:28 -06:00
|
|
|
sonic-cfggen -d -y /etc/sonic/constants.yml -t /usr/share/sonic/templates/bgpd.conf.j2 > /etc/frr/bgpd.conf
|
2019-05-09 01:00:49 -05:00
|
|
|
sonic-cfggen -d -t /usr/share/sonic/templates/zebra.conf.j2 > /etc/frr/zebra.conf
|
2019-08-16 16:29:42 -05:00
|
|
|
sonic-cfggen -d -t /usr/share/sonic/templates/staticd.conf.j2 > /etc/frr/staticd.conf
|
2019-06-12 03:09:31 -05:00
|
|
|
echo "no service integrated-vtysh-config" > /etc/frr/vtysh.conf
|
2019-06-01 11:33:52 -05:00
|
|
|
rm -f /etc/frr/frr.conf
|
2019-05-09 01:00:49 -05:00
|
|
|
elif [ "$CONFIG_TYPE" == "unified" ]; then
|
2019-11-06 18:07:28 -06:00
|
|
|
sonic-cfggen -d -y /etc/sonic/constants.yml -t /usr/share/sonic/templates/frr.conf.j2 >/etc/frr/frr.conf
|
2019-05-09 01:00:49 -05:00
|
|
|
echo "service integrated-vtysh-config" > /etc/frr/vtysh.conf
|
2019-08-16 16:29:42 -05:00
|
|
|
rm -f /etc/frr/bgpd.conf /etc/frr/zebra.conf /etc/frr/staticd.conf
|
2019-05-09 01:00:49 -05:00
|
|
|
fi
|
|
|
|
|
2019-10-15 13:45:09 -05:00
|
|
|
chown -R frr:frr /etc/frr/
|
|
|
|
|
2019-05-09 01:00:49 -05:00
|
|
|
sonic-cfggen -d -t /usr/share/sonic/templates/isolate.j2 > /usr/sbin/bgp-isolate
|
|
|
|
chown root:root /usr/sbin/bgp-isolate
|
|
|
|
chmod 0755 /usr/sbin/bgp-isolate
|
|
|
|
|
|
|
|
sonic-cfggen -d -t /usr/share/sonic/templates/unisolate.j2 > /usr/sbin/bgp-unisolate
|
|
|
|
chown root:root /usr/sbin/bgp-unisolate
|
|
|
|
chmod 0755 /usr/sbin/bgp-unisolate
|
|
|
|
|
|
|
|
mkdir -p /var/sonic
|
|
|
|
echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status
|
2016-07-26 14:01:58 -05:00
|
|
|
|
2017-03-29 20:07:25 -05:00
|
|
|
rm -f /var/run/rsyslogd.pid
|
2019-05-09 01:00:49 -05:00
|
|
|
|
|
|
|
supervisorctl start rsyslogd
|
|
|
|
|
|
|
|
# Start Quagga processes
|
|
|
|
supervisorctl start zebra
|
2019-05-16 12:59:12 -05:00
|
|
|
supervisorctl start staticd
|
2019-05-09 01:00:49 -05:00
|
|
|
supervisorctl start bgpd
|
|
|
|
|
2019-06-01 11:33:52 -05:00
|
|
|
if [ "$CONFIG_TYPE" == "unified" ]; then
|
2019-05-09 01:00:49 -05:00
|
|
|
supervisorctl start vtysh_b
|
|
|
|
fi
|
|
|
|
|
|
|
|
supervisorctl start fpmsyncd
|
2019-10-24 09:35:14 -05:00
|
|
|
|
|
|
|
supervisorctl start bgpcfgd
|