2017-08-01 21:02:00 -05:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Wait until redis starts
|
2020-05-06 17:41:28 -05:00
|
|
|
until [[ $(sonic-db-cli PING | grep -c PONG) -gt 0 ]]; do
|
2018-01-18 21:55:11 -06:00
|
|
|
sleep 1;
|
2017-08-01 21:02:00 -05:00
|
|
|
done
|
|
|
|
|
2020-03-05 17:35:35 -06:00
|
|
|
# If there is a config_db.json dump file, load it.
|
2017-08-01 21:02:00 -05:00
|
|
|
if [ -r /etc/sonic/config_db.json ]; then
|
2020-03-05 17:35:35 -06:00
|
|
|
if [ -r /etc/sonic/init_cfg.json ]; then
|
|
|
|
sonic-cfggen -j /etc/sonic/init_cfg.json -j /etc/sonic/config_db.json --write-to-db
|
|
|
|
else
|
|
|
|
sonic-cfggen -j /etc/sonic/config_db.json --write-to-db
|
|
|
|
fi
|
2017-08-01 21:02:00 -05:00
|
|
|
fi
|
|
|
|
|
2020-01-22 13:26:23 -06:00
|
|
|
sonic-db-cli CONFIG_DB SET "CONFIG_DB_INITIALIZED" "1"
|