From f592a8ae097d659a12363f6d716f905e3e94fd59 Mon Sep 17 00:00:00 2001 From: Clemens John Date: Sat, 4 May 2013 00:25:03 +0200 Subject: [PATCH] Store api key of router owner to be able to use netmons new REST API --- bsp/default/root_file_system/etc/config/configurator | 1 + bsp/default/root_file_system/etc/configurator.sh | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bsp/default/root_file_system/etc/config/configurator b/bsp/default/root_file_system/etc/config/configurator index 325fdad..89c0c78 100644 --- a/bsp/default/root_file_system/etc/config/configurator +++ b/bsp/default/root_file_system/etc/config/configurator @@ -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' diff --git a/bsp/default/root_file_system/etc/configurator.sh b/bsp/default/root_file_system/etc/configurator.sh index cb59ec1..0f771b1 100644 --- a/bsp/default/root_file_system/etc/configurator.sh +++ b/bsp/default/root_file_system/etc/configurator.sh @@ -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