Store api key of router owner to be able to use netmons new REST API

This commit is contained in:
Clemens John 2013-05-04 00:25:03 +02:00
parent 66d46b1860
commit f592a8ae09
2 changed files with 4 additions and 2 deletions

View File

@ -10,6 +10,7 @@ config 'api'
option 'ipv6_address' 'fe80::201:2ff:fe03:405'
option 'timeout' '5'
option 'retry' '5'
option 'api_key' '1'
config 'crawl'
option 'method' 'hash'

View File

@ -84,12 +84,13 @@ assign_router() {
err "Failure on router_auto_assign: $errstr. Exiting"
exit 0
elif [ "$ret" = "success" ]; then
update_hash=${ergebnis%;*}
update_hash=${ergebnis%;*;*}
update_hash=${update_hash##*;}
api_key=${ergebnis##*;}
#write new config
uci set configurator.@crawl[0].router_id=$errstr
uci set configurator.@crawl[0].update_hash=$update_hash
uci set configurator.@api[0].api_key=$api_key
#set also new router id for nodewatcher
#uci set nodewatcher.@crawl[0].router_id=$errstr