blob: 385503f01c3bcceaf4dc419c54f853e4390682d3 [file] [log] [blame]
Jan Kundrát80972db2023-06-05 22:27:16 +02001#!/bin/bash
2
3CONFIG_FILE=/cfg/sysrepo/startup.json
4NEW_COPY=/cfg/sysrepo/startup.json.2
5
6sysrepocfg -d startup -f json -X > ${NEW_COPY}
7if [ ! -s ${NEW_COPY} ]; then
8 logger -p user.emerg "Corrupted sysrepo configuration dump"
9 exit 1
10fi
11sync ${NEW_COPY}
12mv ${NEW_COPY} ${CONFIG_FILE}
13sync ${CONFIG_FILE}