X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=ntsimulator%2Fdeploy%2Fo-ran-sc%2Fo-ran-ru%2Fsysrepo-configuration-load.sh;fp=ntsimulator%2Fdeploy%2Fo-ran-sc%2Fo-ran-ru%2Fsysrepo-configuration-load.sh;h=34a1e7990e37e1d93a3ca4007d48e9c499897f69;hb=1f1479ff8ce3a268acb7b70a32bb789d859a915b;hp=0000000000000000000000000000000000000000;hpb=34ec819462d5f81ceeb723e47467bf50a8454f34;p=sim%2Fo1-interface.git diff --git a/ntsimulator/deploy/o-ran-sc/o-ran-ru/sysrepo-configuration-load.sh b/ntsimulator/deploy/o-ran-sc/o-ran-ru/sysrepo-configuration-load.sh new file mode 100755 index 0000000..34a1e79 --- /dev/null +++ b/ntsimulator/deploy/o-ran-sc/o-ran-ru/sysrepo-configuration-load.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +sleep 20 + +echo "Loading data into sysrepo..." + +: ${SYSREPOCFG:=sysrepocfg} + +pyang -f sample-xml-skeleton --sample-xml-list-entries 1 *.yang + +mapfile -t modelList < <(ls -S -lr *.xml | awk {'print $9'}) + +if [ ${#modelList[@]} -eq 0 ]; then + echo "No modules present, nothing to do..." + exit 0 +else + for model in ${modelList[@]} + do + modelName=${model%".xml"} + + echo "Importing data for module: $model" + $SYSREPOCFG --import=$model --format=xml $modelName + + done +fi + +echo "Finished loading data into sysrepo..." + +exit 0 \ No newline at end of file