X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=ntsimulator%2Fdeploy%2Ftls%2Fenable_netconf_call_home.sh;fp=ntsimulator%2Fdeploy%2Ftls%2Fenable_netconf_call_home.sh;h=0000000000000000000000000000000000000000;hb=f1d5c9198acde7a7ce296490087cad37e008f688;hp=5d453ea01949322dfef1bfb29c12f328692f4e42;hpb=f2d8f1002fa93848c80a88e5658db4816cba3020;p=sim%2Fo1-interface.git diff --git a/ntsimulator/deploy/tls/enable_netconf_call_home.sh b/ntsimulator/deploy/tls/enable_netconf_call_home.sh deleted file mode 100755 index 5d453ea..0000000 --- a/ntsimulator/deploy/tls/enable_netconf_call_home.sh +++ /dev/null @@ -1,94 +0,0 @@ -#! /bin/bash -################################################################################ -# -# Copyright 2020 highstreet technologies GmbH and others -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -################################################################################ - -sleep 20 - -netconf_call_home=`jq '.["netconf-call-home"]' /opt/dev/scripts/configuration.json` - - -if [ $netconf_call_home = "false" ] ; then - echo "NETCONF Call Home is disabled, nothing to do..." - exit 0 -else - echo "Enabling NETCONF Call Home in device..." -fi - -controller_ip=`jq '.["controller-details"] ."controller-ip"' /opt/dev/scripts/configuration.json` -controller_username=`jq '.["controller-details"] ."controller-username"' /opt/dev/scripts/configuration.json` -controller_password=`jq '.["controller-details"] ."controller-password"' /opt/dev/scripts/configuration.json` -controller_port=`jq '.["controller-details"] ."controller-port"' /opt/dev/scripts/configuration.json` -netconf_call_home_port=`jq '.["controller-details"] ."netconf-call-home-port"' /opt/dev/scripts/configuration.json` - -SSH_PUB_KEY_MELACON="$(cat /home/netconf/.ssh/melacon.server.key.pub | awk '{print $2}')" - -payload='{ - "odl-netconf-callhome-server:device": [ - { - "odl-netconf-callhome-server:unique-id": "'$HOSTNAME'", - "odl-netconf-callhome-server:ssh-host-key": "'$SSH_PUB_KEY_MELACON'", - "odl-netconf-callhome-server:credentials": { - "odl-netconf-callhome-server:username": "netconf", - "odl-netconf-callhome-server:passwords": [ - "netconf" - ] - } - } - ] -}' - -odl_ip=`sed -e 's/^"//' -e 's/"$//' <<<"$controller_ip"` -odl_username=`sed -e 's/^"//' -e 's/"$//' <<<"$controller_username"` -odl_password=`sed -e 's/^"//' -e 's/"$//' <<<"$controller_password"` - -echo "Payload: $payload" - -curl -v -H 'Content-Type: application/json' -X PUT -u $odl_username:$odl_password \ --d "$payload" http://$odl_ip:$controller_port/restconf/config/odl-netconf-callhome-server:netconf-callhome-server/allowed-devices/device/$HOSTNAME - -echo ' - - - test_ssh_ch_client - - - - test_ssh_ch_endpt -
'$odl_ip'
- '$netconf_call_home_port' -
-
- - - melacon server key - melacon_server_key - - -
- - - -
-
-
' > connections.xml - -sysrepocfg --merge=connections.xml --format=xml ietf-netconf-server -rm connections.xml - -echo 'Done' -exit 0 \ No newline at end of file