netopeer2: modified uci-default script

Signed-off-by: Mislav Novakovic <mislav.novakovic@sartura.hr>
This commit is contained in:
Mislav Novakovic
2017-05-23 12:46:36 +02:00
parent f6aa981a56
commit 7139808c45
2 changed files with 49 additions and 19 deletions
@@ -3,9 +3,14 @@
# Warning, problems can occur if the device restarts in the middle of this uci-default script
if [ -x /bin/sysrepoctl ]; then
sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-keystore.yang -o root:root -p 600
sysrepocfg -d startup -i /usr/share/netopeer2-keystored/stock_key_config.xml ietf-keystore
rm /usr/share/netopeer2-keystored/stock_key_config.xml
match=$(sysrepoctl -l | grep "ietf-keystore\ ")
if [ ! "$match" ]; then
sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-keystore.yang -o root:root -p 600
if [ -x /bin/sysrepocfg ]; then
sysrepocfg -d startup -i /usr/share/netopeer2-keystored/stock_key_config.xml ietf-keystore
rm /usr/share/netopeer2-keystored/stock_key_config.xml
fi
fi
fi
exit 0