X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=ntsimulator%2Fyang%2Fsysrepo-configuration-load.sh;h=379ea70f8beaaba1f012cded059bc8fb22018bb3;hb=048a8673d15e0329cd79594028f19ba315ba7140;hp=8c41b40c660acfeb7f6113d8f6d46fda84f7c550;hpb=1f1479ff8ce3a268acb7b70a32bb789d859a915b;p=sim%2Fo1-interface.git diff --git a/ntsimulator/yang/sysrepo-configuration-load.sh b/ntsimulator/yang/sysrepo-configuration-load.sh index 8c41b40..379ea70 100755 --- a/ntsimulator/yang/sysrepo-configuration-load.sh +++ b/ntsimulator/yang/sysrepo-configuration-load.sh @@ -20,19 +20,21 @@ sleep 20 echo "Loading data into sysrepo..." -#SSH_PUB_KEY="$(cat /home/netconf/.ssh/id_dsa.pub| awk '{print $2}')" +result=$(netopeer2-cli <<-END + knownhosts --del 0 + knownhosts --del 0 +END +) -#echo 'netconfssh_keyssh-dss' >> load_auth_pubkey.xml -#echo ''"$SSH_PUB_KEY"'' >> load_auth_pubkey.xml +SSH_PUB_KEY_MELACON="$(cat /home/netconf/.ssh/melacon.server.key.pub)" -#sysrepocfg --merge=load_auth_pubkey.xml --format=xml ietf-system -#rm load_auth_pubkey.xml -# -#ssh-keyscan -p 830 localhost >> ~/.ssh/known_hosts +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 @@ -58,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