mirror of
				https://github.com/Telecominfraproject/wlan-cloud-owprov.git
				synced 2025-10-29 09:42:38 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			506 lines
		
	
	
		
			16 KiB
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			506 lines
		
	
	
		
			16 KiB
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
| #!/bin/bash
 | |
| 
 | |
| #
 | |
| #	License type: BSD 3-Clause License
 | |
| #	License copy: https://github.com/Telecominfraproject/wlan-cloud-ucentralgw/blob/master/LICENSE
 | |
| #
 | |
| #	Created by Stephane Bourque on 2021-03-04.
 | |
| #	Arilia Wireless Inc.
 | |
| #
 | |
| 
 | |
| if [[ "$(which jq)" == "" ]]
 | |
| then
 | |
|   echo "You need the package jq installed to use this script."
 | |
|   exit 1
 | |
| fi
 | |
| 
 | |
| if [[ "$(which curl)" == "" ]]
 | |
| then
 | |
|   echo "You need the package curl installed to use this script."
 | |
|   exit 1
 | |
| fi
 | |
| 
 | |
| if [[ "${OWSEC}" == "" ]]
 | |
| then
 | |
|   echo "You must set the variable OWSEC in order to use this script. Something like"
 | |
|   echo "OWSEC=security.isp.com:16001"
 | |
|   exit 1
 | |
| fi
 | |
| 
 | |
| if [[ "${FLAGS}" == "" ]]
 | |
| then
 | |
| 	FLAGS="-s"
 | |
| fi
 | |
| 
 | |
| token=""
 | |
| result_file=result.json
 | |
| username="tip@ucentral.com"
 | |
| password="openwifi"
 | |
| browser_list=(firefox sensible-browser xdg-open w3m links links2 lynx youtube-dl)
 | |
| browser=""
 | |
| 
 | |
| login() {
 | |
|   payload="{ \"userId\" : \"$username\" , \"password\" : \"$password\" }"
 | |
|   token=$(curl ${FLAGS} -X POST -H "Content-Type: application/json" -d "$payload" "https://${OWSEC}/api/v1/oauth2" | jq -r '.access_token')
 | |
| 
 | |
|   if [[ "${token}" == "" ]]
 | |
|   then
 | |
|   	echo "Could not login. Please verify the host and username/password."
 | |
|     exit 13
 | |
|   fi
 | |
|   echo "${token}" > token.json
 | |
|   setprov
 | |
| }
 | |
| 
 | |
| findbrowser() {
 | |
| 	if [[ "${browser}" != "" ]]
 | |
| 	then
 | |
| 		echo
 | |
| 	elif [[ "$(uname)" == "Darwin" ]]
 | |
| 	then
 | |
| 		browser=open
 | |
| 	else
 | |
| 		BROWSER_LIST=(firefox sensible-browser xdg-open w3m links links2 lynx youtube-dl)
 | |
| 		for br_name in "${browser_list[@]}"
 | |
| 		do
 | |
| 			if [[ $(which ${br_name}) != "" ]]
 | |
| 			then
 | |
| 				browser=${br_name}
 | |
| 				break
 | |
| 			fi
 | |
| 		done
 | |
| 	fi
 | |
| }
 | |
| 
 | |
| setprov() {
 | |
| 	curl  ${FLAGS} -X GET "https://${OWSEC}/api/v1/systemEndpoints" \
 | |
|         -H "accept: application/json" \
 | |
|         -H "Authorization: Bearer ${token}"  > ${result_file}
 | |
| #	jq < ${result_file}
 | |
| 
 | |
| 	for index in {0..10}
 | |
| 	do
 | |
| 		endpointlocation=".endpoints[${index}].uri"
 | |
| 	endpointlocationtype=".endpoints[${index}].type"
 | |
| 	rawurl="$(cat ${result_file} | jq -r ${endpointlocation})"
 | |
| 	svctype="$(cat ${result_file} | jq -r ${endpointlocationtype})"
 | |
| 	proto="$(echo $rawurl | grep :// | sed -e's,^\(.*://\).*,\1,g')"
 | |
| 	url="$(echo ${rawurl/$proto/})"
 | |
| 	user="$(echo $url | grep @ | cut -d@ -f1)"
 | |
| 	hostport="$(echo ${url/$user@/} | cut -d/ -f1)"
 | |
| 	host="$(echo $hostport | sed -e 's,:.*,,g')"
 | |
| 	port="$(echo $hostport | sed -e 's,^.*:,:,g' -e 's,.*:\([0-9]*\).*,\1,g' -e 's,[^0-9],,g')"
 | |
| 	path="$(echo $url | grep / | cut -d/ -f2-)"
 | |
| 	if [[ ${url} != "null" ]]
 | |
| 		then
 | |
| 		if [[ ${svctype} == "owprov" ]]
 | |
| 			then
 | |
| 			OWPROV="${url}"
 | |
| 			break
 | |
| 		fi
 | |
| 	fi
 | |
| 	done
 | |
| 	echo "Using ${OWPROV}..."
 | |
| }
 | |
| 
 | |
| logout() {
 | |
|   curl  ${FLAGS} -X DELETE -H "Content-Type: application/json" \
 | |
|         -H "Authorization: Bearer ${token}" \
 | |
|         "https://${OWSEC}/api/v1/oauth2/${token}"
 | |
|   rm -rf token.json
 | |
| }
 | |
| 
 | |
| getroot() {
 | |
|     curl    ${FLAGS} \
 | |
|             -H "Content-Type: application/json" \
 | |
|             -H "Authorization: Bearer ${token}" \
 | |
|             -H "accept: application/json" \
 | |
|             "https://${OWPROV}/api/v1/entity/0000-0000-0000"  > ${result_file}
 | |
|     jq < ${result_file}
 | |
| }
 | |
| 
 | |
| setroot() {
 | |
|     payload="{ \"name\" : \"Arilia Root\", \"description\" : \"This is the top level entry in the hierarchy.\" }";
 | |
|     curl    ${FLAGS} -X POST "https://${OWPROV}/api/v1/entity/0000-0000-0000" \
 | |
|     -H "Content-Type: application/json" \
 | |
|     -H "Authorization: Bearer ${token}" \
 | |
|     -H "accept: application/json" \
 | |
|     -d "$payload" > ${result_file}
 | |
|     jq < ${result_file}
 | |
| }
 | |
| 
 | |
| addentity() {
 | |
|     payload="{ \"name\" : \"$1\", \"description\" : \"sub entity.\", \"parent\" : \"0000-0000-0000\", \"notes\" : [ {\"note\" : \"CLI added\"} ] }";
 | |
|     curl    ${FLAGS} -X POST "https://${OWPROV}/api/v1/entity/1" \
 | |
|     -H "Content-Type: application/json" \
 | |
|     -H "Authorization: Bearer ${token}" \
 | |
|     -H "accept: application/json" \
 | |
|     -d "$payload" > ${result_file}
 | |
|     jq < ${result_file}
 | |
| }
 | |
| 
 | |
| getentity() {
 | |
|     curl    ${FLAGS} "https://${OWPROV}/api/v1/entity/$1" \
 | |
|     -H "Content-Type: application/json" \
 | |
|     -H "Authorization: Bearer ${token}" \
 | |
|     -H "accept: application/json" > ${result_file}
 | |
|     jq < ${result_file}
 | |
| }
 | |
| 
 | |
| getentities() {
 | |
|     curl    ${FLAGS} "https://${OWPROV}/api/v1/entity" \
 | |
|     -H "Content-Type: application/json" \
 | |
|     -H "Authorization: Bearer ${token}" \
 | |
|     -H "accept: application/json" > ${result_file}
 | |
|     jq < ${result_file}
 | |
| }
 | |
| 
 | |
| tree() {
 | |
|     curl    ${FLAGS} "https://${OWPROV}/api/v1/entity?getTree=true" \
 | |
|     -H "Content-Type: application/json" \
 | |
|     -H "Authorization: Bearer ${token}" \
 | |
|     -H "accept: application/json" > ${result_file}
 | |
|     jq < ${result_file}
 | |
| }
 | |
| 
 | |
| importtree() {
 | |
|     curl    ${FLAGS} -X POST "https://${OWPROV}/api/v1/entity?setTree=true" \
 | |
|     -H "Content-Type: application/json" \
 | |
|     -H "Authorization: Bearer ${token}" \
 | |
|     -H "accept: application/json " \
 | |
|     --data "@$1" > ${result_file}
 | |
|     jq < ${result_file}
 | |
| }
 | |
| 
 | |
| gettag() {
 | |
|     curl    ${FLAGS} "https://${OWPROV}/api/v1/inventory?entity=$1" \
 | |
|     -H "Content-Type: application/json" \
 | |
|     -H "Authorization: Bearer ${token}" \
 | |
|     -H "accept: application/json" > ${result_file}
 | |
|     jq < ${result_file}
 | |
| }
 | |
| 
 | |
| addtag() {
 | |
|     payload="{ \"name\" : \"$1\", \"serialNumber\" : \"$1\", \"deviceType\" : \"linksys_ea8300\" }";
 | |
|     curl    ${FLAGS} -X POST "https://${OWPROV}/api/v1/inventory/1" \
 | |
|     -H "Content-Type: application/json" \
 | |
|     -H "Authorization: Bearer ${token}" \
 | |
|     -H "accept: application/json" \
 | |
|     -d "$payload" > ${result_file}
 | |
|     jq < ${result_file}
 | |
| }
 | |
| 
 | |
| addunassignedtag() {
 | |
|     payload="{ \"name\" : \"$1\", \"serialNumber\" : \"$1\", \"deviceType\" : \"linksys_ea8300\" }";
 | |
|     curl    ${FLAGS} -X POST "https://${OWPROV}/api/v1/inventory/1" \
 | |
|     -H "Content-Type: application/json" \
 | |
|     -H "Authorization: Bearer ${token}" \
 | |
|     -H "accept: application/json" \
 | |
|     -d "$payload" > ${result_file}
 | |
|     jq < ${result_file}
 | |
| }
 | |
| 
 | |
| assigntagentity() {
 | |
|     payload="{\"serialNumber\" : \"$1\", \"entity\" : \"$2\"}";
 | |
|     curl    ${FLAGS} -X PUT "https://${OWPROV}/api/v1/inventory/$1" \
 | |
|     -H "Content-Type: application/json" \
 | |
|     -H "Authorization: Bearer ${token}" \
 | |
|     -H "accept: application/json" \
 | |
|     -d "$payload" > ${result_file}
 | |
|     jq < ${result_file}
 | |
| }
 | |
| 
 | |
| assigntagvenue() {
 | |
|     payload="{\"serialNumber\" : \"$1\", \"venue\" : \"$2\"}";
 | |
|     curl    ${FLAGS} -X PUT "https://${OWPROV}/api/v1/inventory/$1" \
 | |
|     -H "Content-Type: application/json" \
 | |
|     -H "Authorization: Bearer ${token}" \
 | |
|     -H "accept: application/json" \
 | |
|     -d "$payload" > ${result_file}
 | |
|     jq < ${result_file}
 | |
| }
 | |
| 
 | |
| unassigntag() {
 | |
|     payload="{\"serialNumber\" : \"$1\" }";
 | |
|     curl    ${FLAGS} -X PUT "https://${OWPROV}/api/v1/inventory/$1?unassign=true" \
 | |
|     -H "Content-Type: application/json" \
 | |
|     -H "Authorization: Bearer ${token}" \
 | |
|     -H "accept: application/json" \
 | |
|     -d "$payload" > ${result_file}
 | |
|     jq < ${result_file}
 | |
| }
 | |
| 
 | |
| gettags() {
 | |
|     curl ${FLAGS} "https://${OWPROV}/api/v1/inventory" \
 | |
|     -H "Content-Type: application/json" \
 | |
|     -H "Authorization: Bearer ${token}" \
 | |
|     -H "accept: application/json" > ${result_file}
 | |
|     jq < ${result_file}
 | |
| }
 | |
| 
 | |
| getunassignedtags(){
 | |
|     curl ${FLAGS} "https://${OWPROV}/api/v1/inventory?unassigned=true" \
 | |
|     -H "Content-Type: application/json" \
 | |
|     -H "Authorization: Bearer ${token}" \
 | |
|     -H "accept: application/json" > ${result_file}
 | |
|     jq < ${result_file}
 | |
| }
 | |
| 
 | |
| tagcount() {
 | |
|     curl ${FLAGS} "https://${OWPROV}/api/v1/inventory?countOnly=true" \
 | |
|     -H "Content-Type: application/json" \
 | |
|     -H "Authorization: Bearer ${token}" \
 | |
|     -H "accept: application/json" > ${result_file}
 | |
|     jq < ${result_file}
 | |
| }
 | |
| 
 | |
| entitycount() {
 | |
|     curl ${FLAGS} "https://${OWPROV}/api/v1/entity?countOnly=true" \
 | |
|     -H "Content-Type: application/json" \
 | |
|     -H "Authorization: Bearer ${token}" \
 | |
|     -H "accept: application/json" > ${result_file}
 | |
|     jq < ${result_file}
 | |
| }
 | |
| 
 | |
| venuecount() {
 | |
|     curl ${FLAGS} "https://${OWPROV}/api/v1/venue?countOnly=true" \
 | |
|     -H "Content-Type: application/json" \
 | |
|     -H "Authorization: Bearer ${token}" \
 | |
|     -H "accept: application/json" > ${result_file}
 | |
|     jq < ${result_file}
 | |
| }
 | |
| 
 | |
| contactcount() {
 | |
|     curl ${FLAGS} "https://${OWPROV}/api/v1/contact?countOnly=true" \
 | |
|     -H "Content-Type: application/json" \
 | |
|     -H "Authorization: Bearer ${token}" \
 | |
|     -H "accept: application/json" > ${result_file}
 | |
|     jq < ${result_file}
 | |
| }
 | |
| 
 | |
| locationcount() {
 | |
|     curl ${FLAGS} "https://${OWPROV}/api/v1/location?countOnly=true" \
 | |
|     -H "Content-Type: application/json" \
 | |
|     -H "Authorization: Bearer ${token}" \
 | |
|     -H "accept: application/json" > ${result_file}
 | |
|     jq < ${result_file}
 | |
| }
 | |
| 
 | |
| addconfig() {
 | |
|     payload="{ \"name\" : \"$1\", \"deviceTypes\" : [\"*\"], \"configuration\" : [ { \"name\" : \"radios\" , \"weight\" : 100, \"configuration\" : { \"radios\": [{ \"band\": \"5G\", \"channel\": 52, \"channel-mode\": \"HE\", \"channel-width\": 80, \"country\": \"CA\" }, { \"band\": \"2G\", \"channel\": 11, \"channel-mode\": \"HE\", \"channel-width\": 20, \"country\": \"CA\" } ] } }] }"
 | |
|     curl    ${FLAGS} -X POST "https://${OWPROV}/api/v1/configurations/1" \
 | |
|     -H "Content-Type: application/json" \
 | |
|     -H "Authorization: Bearer ${token}" \
 | |
|     -H "accept: application/json" \
 | |
|     -d "$payload" > ${result_file}
 | |
|     echo ${payload}
 | |
|     jq < ${result_file}
 | |
| }
 | |
| 
 | |
| addconfigtx() {
 | |
|     payload="{ \"name\" : \"$1\", \"deviceTypes\" : [\"*\"], \"configuration\" : [ { \"name\" : \"radios TX\" , \"weight\" : 0, \"configuration\" : { \"radios\": [{ \"band\": \"2G\", \"tx-power\": 45 } ] } }] }"
 | |
|     curl    ${FLAGS} -X POST "https://${OWPROV}/api/v1/configurations/1" \
 | |
|     -H "Content-Type: application/json" \
 | |
|     -H "Authorization: Bearer ${token}" \
 | |
|     -H "accept: application/json" \
 | |
|     -d "$payload" > ${result_file}
 | |
|     echo ${payload}
 | |
|     jq < ${result_file}
 | |
| }
 | |
| 
 | |
| addconfigmetrics() {
 | |
|     payload="{ \"name\" : \"$1\", \"deviceTypes\" : [\"*\"], \"configuration\" : [ { \"name\" : \"metrics gen\" , \"weight\" : 0, \"configuration\" : { \"metrics\":  { \"statistics\": { \"interval\": 120, \"types\": [ \"ssids\", \"lldp\", \"clients\" ] } } } }] }"
 | |
|     curl    ${FLAGS} -X POST "https://${OWPROV}/api/v1/configurations/1" \
 | |
|     -H "Content-Type: application/json" \
 | |
|     -H "Authorization: Bearer ${token}" \
 | |
|     -H "accept: application/json" \
 | |
|     -d "$payload" > ${result_file}
 | |
|     echo ${payload}
 | |
|     jq < ${result_file}
 | |
| }
 | |
| 
 | |
| addconfigfile() {
 | |
|     curl    ${FLAGS} -X POST "https://${OWPROV}/api/v1/configurations/1" \
 | |
|     -H "Content-Type: application/json" \
 | |
|     -H "Authorization: Bearer ${token}" \
 | |
|     -H "accept: application/json" \
 | |
|     -d @"$1" > ${result_file}
 | |
|     jq < ${result_file}
 | |
| }
 | |
| 
 | |
| getconfig() {
 | |
|     curl    ${FLAGS}  "https://${OWPROV}/api/v1/configurations/$1" \
 | |
|     -H "Content-Type: application/json" \
 | |
|     -H "Authorization: Bearer ${token}" \
 | |
|     -H "accept: application/json" > ${result_file}
 | |
|     jq < ${result_file}
 | |
| }
 | |
| 
 | |
| deleteconfig() {
 | |
|     curl    ${FLAGS} -X DELETE  "https://${OWPROV}/api/v1/configurations/$1" \
 | |
|     -H "Content-Type: application/json" \
 | |
|     -H "Authorization: Bearer ${token}" \
 | |
|     -H "accept: application/json" > ${result_file}
 | |
|     jq < ${result_file}
 | |
| }
 | |
| 
 | |
| setentityconfig() {
 | |
|     payload="{\"deviceConfiguration\" : \"$2\"}";
 | |
|     curl    ${FLAGS} -X PUT "https://${OWPROV}/api/v1/entity/$1" \
 | |
|     -H "Content-Type: application/json" \
 | |
|     -H "Authorization: Bearer ${token}" \
 | |
|     -H "accept: application/json" \
 | |
|     -d "$payload" > ${result_file}
 | |
|     jq < ${result_file}
 | |
| }
 | |
| 
 | |
| listconfigs() {
 | |
|     curl    ${FLAGS}  "https://${OWPROV}/api/v1/configurations" \
 | |
|     -H "Content-Type: application/json" \
 | |
|     -H "Authorization: Bearer ${token}" \
 | |
|     -H "accept: application/json" > ${result_file}
 | |
|     jq < ${result_file}
 | |
| }
 | |
| 
 | |
| deviceconfig() {
 | |
|     curl    ${FLAGS} "https://${OWPROV}/api/v1/inventory/$1?config=true&explain=true" \
 | |
|     -H "Content-Type: application/json" \
 | |
|     -H "Authorization: Bearer ${token}" \
 | |
|     -H "accept: application/json" > ${result_file}
 | |
|     jq < ${result_file}
 | |
| }
 | |
| 
 | |
| devicefwoptions() {
 | |
|     curl    ${FLAGS} "https://${OWPROV}/api/v1/inventory/$1?firmwareOptions=true" \
 | |
|     -H "Content-Type: application/json" \
 | |
|     -H "Authorization: Bearer ${token}" \
 | |
|     -H "accept: application/json" > ${result_file}
 | |
|     jq < ${result_file}
 | |
| }
 | |
| 
 | |
| adddeviceconfig() {
 | |
|     payload="{\"deviceConfiguration\" : \"$2\"}";
 | |
|     curl    ${FLAGS} -X PUT "https://${OWPROV}/api/v1/inventory/$1" \
 | |
|     -H "Content-Type: application/json" \
 | |
|     -H "Authorization: Bearer ${token}" \
 | |
|     -H "accept: application/json" \
 | |
|     -d "$payload" > ${result_file}
 | |
|     jq < ${result_file}
 | |
| }
 | |
| 
 | |
| validateconfig() {
 | |
|     curl    ${FLAGS} -X POST "https://${OWPROV}/api/v1/configurations/1?validateOnly=true" \
 | |
|     -H "Content-Type: application/json" \
 | |
|     -H "Authorization: Bearer ${token}" \
 | |
|     -H "accept: application/json" \
 | |
|     -d @"$1" > ${result_file}
 | |
|     jq < ${result_file}
 | |
| }
 | |
| 
 | |
| setloglevel() {
 | |
|     payload="{ \"command\" : \"setloglevel\" , \"subsystems\" : [ { \"tag\" : \"$1\" , \"value\" : \"$2\" } ] }"
 | |
|             curl  ${FLAGS} -X POST "https://${OWPROV}/api/v1/system" \
 | |
|             -H  "accept: application/json" \
 | |
|             -H "Authorization: Bearer ${token}" \
 | |
|             -d "$payload"
 | |
| }
 | |
| 
 | |
| getloglevels() {
 | |
|     payload="{ \"command\" : \"getloglevels\" }"
 | |
|             curl  ${FLAGS} -X POST "https://${OWPROV}/api/v1/system" \
 | |
|             -H  "accept: application/json" \
 | |
|             -H "Authorization: Bearer ${token}" \
 | |
|             -d "$payload"
 | |
| }
 | |
| 
 | |
| getloglevelnames() {
 | |
|     payload="{ \"command\" : \"getloglevelnames\" }"
 | |
|             curl  ${FLAGS} -X POST "https://${OWPROV}/api/v1/system" \
 | |
|             -H  "accept: application/json" \
 | |
|             -H "Authorization: Bearer ${token}" \
 | |
|             -d "$payload"
 | |
| }
 | |
| 
 | |
| getsubsystemnames() {
 | |
|     payload="{ \"command\" : \"getsubsystemnames\" }"
 | |
|             curl  ${FLAGS} -X POST "https://${OWPROV}/api/v1/system" \
 | |
|             -H  "accept: application/json" \
 | |
|             -H "Authorization: Bearer ${token}" \
 | |
|             -d "$payload"
 | |
| }
 | |
| 
 | |
| systeminfo() {
 | |
|     curl  ${FLAGS} -X GET "https://${OWPROV}/api/v1/system?command=info" \
 | |
|     -H "accept: application/json" \
 | |
|     -H "Authorization: Bearer ${token}" > ${result_file}
 | |
|     jq < ${result_file}
 | |
| }
 | |
| 
 | |
| reloadsubsystem() {
 | |
|     payload="{ \"command\" : \"reload\", \"subsystems\" : [ \"$1\" ] }"
 | |
|             curl  ${FLAGS} -X POST "https://${OWPROV}/api/v1/system" \
 | |
|             -H  "accept: application/json" \
 | |
|             -H "Authorization: Bearer ${token}" \
 | |
|             -d "$payload"
 | |
| }
 | |
| 
 | |
| addresscheck() {
 | |
|     echo "Token:${token}"
 | |
|     wscat -c wss://${OWPROV}/api/v1/ws
 | |
| }
 | |
| 
 | |
| affecteddevices() {
 | |
|     computedAffected
 | |
|     curl    ${FLAGS} -X GET "https://${OWPROV}/api/v1/configurations/${1}?computedAffected=true" \
 | |
|     -H "Content-Type: application/json" \
 | |
|     -H "Authorization: Bearer ${token}" \
 | |
|     -H "accept: application/json" > ${result_file}
 | |
|     jq < ${result_file}
 | |
| }
 | |
| 
 | |
| shopt -s nocasematch
 | |
| case "$1" in
 | |
|     "login") login; help  ; logout ;;
 | |
|     "getroot") login; getroot; logout;;
 | |
|     "setroot") login; setroot; logout;;
 | |
|     "addentity") login; addentity "$2" ; logout;;
 | |
|     "getentity") login; getentity "$2" ; logout;;
 | |
|     "getentities") login; getentities ; logout;;
 | |
|     "entitycount") login; entitycount ; logout;;
 | |
|     "tree") login; tree ; logout;;
 | |
|     "importtree") login; importtree $2; logout;;
 | |
|     "deviceconfig") login; deviceconfig "$2"; logout;;
 | |
|     "devicefwoptions") login; devicefwoptions "$2"; logout;;
 | |
|     "addtag") login; addtag "$2"; logout;;
 | |
|     "unassigntag") login; unassigntag $2; logout;;
 | |
|     "addunassignedtag") login; addunassignedtag $2 ; logout;;
 | |
|     "getunassignedtags") login; getunassignedtags ; logout;;
 | |
|     "gettags") login; gettags ; logout;;
 | |
|     "gettag") login; gettag $2 ; logout;;
 | |
|     "tagcount") login; tagcount ; logout;;
 | |
|     "venuecount") login; venuecount ; logout;;
 | |
|     "contactcount") login; contactcount ; logout;;
 | |
|     "locationcount") login; locationcount ; logout;;
 | |
|     "addconfig") login; addconfig "$2"; logout;;
 | |
|     "addconfigtx") login; addconfigtx "$2"; logout;;
 | |
|     "listconfigs") login; listconfigs ; logout;;
 | |
|     "getconfig") login; getconfig "$2"; logout;;
 | |
|     "deleteconfig") login; deleteconfig "$2"; logout;;
 | |
|     "assigntagentity") login; assigntagentity "$2" "$3"; logout;;
 | |
|     "assigntagvenue") login; assigntagvenue "$2" "$3"; logout;;
 | |
|     "setentityconfig") login; setentityconfig "$2" "$3"; logout;;
 | |
|     "adddeviceconfig") login; adddeviceconfig "$2" "$3"; logout;;
 | |
|     "addconfigmetrics") login; addconfigmetrics "$2" ; logout;;
 | |
|     "addconfigfile") login; addconfigfile "$2" ; logout;;
 | |
|     "validateconfig") login; validateconfig "$2"; logout;;
 | |
|     "setloglevel") login; setloglevel "$2" "$3"  ; logout ;;
 | |
|     "getloglevels") login; getloglevels; logout ;;
 | |
|     "getloglevelnames") login; getloglevelnames; logout ;;
 | |
|     "getsubsystemnames") login; getsubsystemnames; logout ;;
 | |
|     "reloadsubsystem") login; reloadsubsystem "$2"; logout ;;
 | |
|     "systeminfo") login; systeminfo ; logout;;
 | |
|     "addresscheck") login; addresscheck; logout ;;
 | |
|     *) help ;;
 | |
| esac
 | |
| 
 | 
