[radvd] Ensure at least one interface is specified in radvd.conf before starting radvd (#1636)

This commit is contained in:
Joe LeVeque 2018-04-24 15:13:51 -07:00 committed by Guohan Lu
parent a84ca2d5a2
commit f46e873916

View File

@ -14,5 +14,12 @@ fi
# Generate /etc/radvd.conf config file # Generate /etc/radvd.conf config file
sonic-cfggen -d -t /usr/share/sonic/templates/radvd.conf.j2 > /etc/radvd.conf sonic-cfggen -d -t /usr/share/sonic/templates/radvd.conf.j2 > /etc/radvd.conf
# Enusre at least one interface is specified in radvd.conf
NUM_IFACES=$(grep -c "^interface " /etc/radvd.conf)
if [ $NUM_IFACES -eq 0 ]; then
echo "No interfaces specified in radvd.conf. Not starting router advertiser process."
exit 0
fi
# Start the router advertiser # Start the router advertiser
supervisorctl start radvd supervisorctl start radvd