sonic-buildimage/files/scripts/configdb-load.sh
Dong Zhang 7aa0baf709 [MultiDB] (except ./src and ./dockers dirs): replace redis-cli with sonic-db-cli and use new DBConnector (#4035)
* [MultiDB] (except ./src and ./dockers dirs): replace redis-cli with sonic-db-cli and use new DBConnector
* update comment for a potential bug
* update comment
* add TODO maker as review reqirement
2020-01-22 11:26:23 -08:00

14 lines
325 B
Bash
Executable File

#!/usr/bin/env bash
# Wait until redis starts
until [[ $(redis-cli ping | grep -c PONG) -gt 0 ]]; do
sleep 1;
done
# If there is a config db dump file, load it
if [ -r /etc/sonic/config_db.json ]; then
sonic-cfggen -j /etc/sonic/config_db.json --write-to-db
fi
sonic-db-cli CONFIG_DB SET "CONFIG_DB_INITIALIZED" "1"