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