Skip to content

Commit

Permalink
Adding missing script
Browse files Browse the repository at this point in the history
  • Loading branch information
kzangeli committed Oct 11, 2024
1 parent 8b8f82b commit 8042a95
Showing 1 changed file with 80 additions and 0 deletions.
80 changes: 80 additions & 0 deletions scripts/configFile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#!/bin/bash

# Copyright 2021 Telefonica Investigacion y Desarrollo, S.A.U
#
# This file is part of Orion Context Broker.
#
# Orion Context Broker is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# Orion Context Broker is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
# General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with Orion Context Broker. If not, see http://www.gnu.org/licenses/.
#
# For those usages not covered by this license please contact with
# iot_support at tid dot es

echo '{'
echo ' "ddsmodule": {'
echo ' "domain": 0,'
echo ' "allowlist": {'
echo ' "name": "*"'
echo ' },'
echo ' "blocklist": {'
echo ' "name": "add_blocked_topics_list_here"'
echo ' },'
echo ' "topics": {'
echo ' "name": "*",'
echo ' "qos": {'
echo ' "durability": "TRANSIENT_LOCAL",'
echo ' "history-depth": 5'
echo ' }'
echo ' },'
echo ' "enabler": {'
echo ' },'
echo ' "specs": {'
echo ' "threads": 12,'
echo ' "logging": {'
echo ' "stdout": false,'
echo ' "verbosity": "info"'
echo ' }'
echo ' },'
echo ' "ngsild": {'
echo ' "topics": {'


while [ $# != 0 ]
do
items=$1
shift

topic=$(echo $items | awk -F, '{ print $1 }')
eType=$(echo $items | awk -F, '{ print $2 }')
eId=$(echo $items | awk -F, '{ print $3 }')
attr=$(echo $items | awk -F, '{ print $4 }')

if [ $# != 0 ]
then
comma=','
else
comma=''
fi

echo ' "'$topic'": {'
echo ' "entityType": "'$eType'",'
echo ' "entityId": "'$eId'",'
echo ' "attribute": "'$attr'"'
echo ' }'$comma
done


echo ' }'
echo ' }'
echo ' }'
echo '}'

0 comments on commit 8042a95

Please sign in to comment.