X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=sim%2Fo1-interface.git;a=blobdiff_plain;f=ntsimulator%2Fyang%2Fsysrepo-configuration-load.sh;h=379ea70f8beaaba1f012cded059bc8fb22018bb3;hp=71ba5d44ba6a3048b803a3e0f8d0d867e666b8bc;hb=048a8673d15e0329cd79594028f19ba315ba7140;hpb=7dbf479029ba8bc528fb61a40ab2647489da28e9 diff --git a/ntsimulator/yang/sysrepo-configuration-load.sh b/ntsimulator/yang/sysrepo-configuration-load.sh index 71ba5d4..379ea70 100755 --- a/ntsimulator/yang/sysrepo-configuration-load.sh +++ b/ntsimulator/yang/sysrepo-configuration-load.sh @@ -20,9 +20,21 @@ sleep 20 echo "Loading data into sysrepo..." +result=$(netopeer2-cli <<-END + knownhosts --del 0 + knownhosts --del 0 +END +) + +SSH_PUB_KEY_MELACON="$(cat /home/netconf/.ssh/melacon.server.key.pub)" + +echo "Writing the public key to the known_hosts..." +echo "[127.0.0.1]:830 $SSH_PUB_KEY_MELACON" > /root/.ssh/known_hosts + pyang -f sample-xml-skeleton --sample-xml-list-entries 2 *.yang result=$(netopeer2-cli <<-END + auth keys add /home/netconf/.ssh/melacon.server.key.pub /home/netconf/.ssh/melacon.server.key connect --host 127.0.0.1 --login netconf user-rpc --content=/opt/dev/yang/edit_config_operation.xml disconnect @@ -48,6 +60,4 @@ echo "Finished loading data into sysrepo. Removing edit-config XML..." rm -f /opt/dev/yang/edit_config_operation.xml echo "Done..." - - exit 0 \ No newline at end of file