sonic-buildimage/dockers/docker-database/configdb-load.sh
Taoyu Li b6efe438b5 Introduce ConfigDB (#808)
* [cfggen] Support reading from and writing to configdb
* [bgp] Move bgp_admin_state to configdb, support dynamic admin state change
* [sonic-utilities] Adapt configDB for admin status, support config save and config load
2017-08-01 19:02:00 -07:00

18 lines
361 B
Bash
Executable File

#!/usr/bin/env bash
# Wait until redis starts
while true; do
if [ `redis-cli ping` == "PONG" ]; then
break
fi
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
echo -en "SELECT 4\nSET CONFIG_DB_INITIALIZED true" | redis-cli