2 ################################################################################
4 # Copyright 2019 highstreet technologies GmbH and others
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 ################################################################################
21 echo "Loading data into sysrepo..."
23 result=$(netopeer2-cli <<-END
29 SSH_PUB_KEY_MELACON="$(cat /home/netconf/.ssh/melacon.server.key.pub)"
31 echo "Writing the public key to the known_hosts..."
32 echo "[127.0.0.1]:830 $SSH_PUB_KEY_MELACON" > /root/.ssh/known_hosts
34 pyang -f sample-xml-skeleton --sample-xml-list-entries 2 *.yang
36 result=$(netopeer2-cli <<-END
37 auth keys add /home/netconf/.ssh/melacon.server.key.pub /home/netconf/.ssh/melacon.server.key
38 connect --host 127.0.0.1 --login netconf
39 user-rpc --content=/opt/dev/yang/edit_config_operation.xml
46 while [[ $count -le 100 ]] && [[ "$result" != "OK" ]]
49 pyang -f sample-xml-skeleton --sample-xml-list-entries 2 *.yang
51 result=$(netopeer2-cli <<-END
52 connect --host 127.0.0.1 --login netconf
53 user-rpc --content=edit_config_operation.xml
59 echo "Finished loading data into sysrepo. Removing edit-config XML..."
60 rm -f /opt/dev/yang/edit_config_operation.xml