This shows you the differences between two versions of the page.
— | sdk:scripts:status [2015/05/05 15:04] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== SDK Script status.are ====== | ||
+ | <code c status.are> | ||
+ | /* DESC: This script can be used to display all status variables | ||
+ | * Copyright (C) 2012 NetModule AG, Switzerland | ||
+ | */ | ||
+ | |||
+ | sections = mkstruct ( | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ); | ||
+ | |||
+ | sectlist = struct_fields(sections); | ||
+ | |||
+ | for (i = 0; i < length(sectlist); | ||
+ | sect = sectlist[i]; | ||
+ | if (strlen(sect) == 0) continue; | ||
+ | |||
+ | /* check if user specified a section */ | ||
+ | if (argc > 1 && argv[1] != sect) continue; | ||
+ | |||
+ | info = struct_get(sections, | ||
+ | printf(" | ||
+ | |||
+ | status = nb_status(sect); | ||
+ | stlist = struct_fields(status); | ||
+ | |||
+ | for (j = 0; j < length(stlist); | ||
+ | key = stlist[j]; | ||
+ | if (strlen(key) > 0) { | ||
+ | value = struct_get(status, | ||
+ | printf(" | ||
+ | } | ||
+ | } | ||
+ | printf(" | ||
+ | } | ||
+ | |||
+ | |||
+ | </ | ||