[pisa-src] r2580 - trunk/openwrt/router-configurations/pisa-testbed/usr/local/malocation/service/request_ap_info

  • From: Nicolai Viol <Nicolai.Viol@xxxxxxxxxxxxxxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Wed, 18 May 2011 20:38:18 +0200

Author: viol
Date: Wed May 18 20:38:16 2011
New Revision: 2580

Log:
added more router infos to the request

Modified:
   
trunk/openwrt/router-configurations/pisa-testbed/usr/local/malocation/service/request_ap_info

Modified: 
trunk/openwrt/router-configurations/pisa-testbed/usr/local/malocation/service/request_ap_info
==============================================================================
--- 
trunk/openwrt/router-configurations/pisa-testbed/usr/local/malocation/service/request_ap_info
       Wed May 18 11:43:14 2011        (r2579)
+++ 
trunk/openwrt/router-configurations/pisa-testbed/usr/local/malocation/service/request_ap_info
       Wed May 18 20:38:16 2011        (r2580)
@@ -13,28 +13,39 @@
 ROUTE=$(route -n | tr '\n' ';')
 IWCONFIG=$(iwconfig wlan0 | tr '\n' ';')
 ASSOCLIST=$(iw dev wlan0 station dump | tr '\n' ';')
-HIP_VERSION=$(hipd -V | tr '\n' ';')
 
+if [ -e /usr/sbin/hipd ]; then HIPD_VERSION=$(hipd -V | head -n 1 | tr '\n' 
';'); fi
+if [ -e /usr/sbin/hipfw ]; then HIPFW_VERSION=$(hipfw -V | head -n 1 | tr '\n' 
';'); fi
+if [ -e /usr/sbin/pisacd ]; then PISACD_VERSION=$(pisacd -V 2>&1 | head -n 1 | 
tr '\n' ';'); fi
+if [ -e /usr/sbin/pisasd ]; then PISASD_VERSION=$(pisasd -V 2>&1 | head -n 1 | 
tr '\n' ';'); fi
+if [ -e /usr/sbin/hipconf ]; then
+HIPCONF_HA=$(hipconf get ha all 2>&1 | tail -n +5 | tr '\n' ';')
+HIPCONF_HI=$(hipconf get hi default 2>&1 | tail -n +5 | tr '\n' ';')
+fi
 
 info_json='{
-   "hostname":"'$HOSTNAME'",
-   "client_ip":"'$REMOTE_ADDR'",
-   "os_release":"'$OS_RELEASE'",
-   "os_version":"'$OS_VERSION'",
-   "uptime":"'$UPTIME'",
-   "eth0":"'$IFCONFIG_eth0'",
-   "eth1":"'$IFCONFIG_eth1'",
-   "wlan0":"'$IFCONFIG_wlan0'",
-   "br-lan":"'$IFCONFIG_brlan'",
-   "route":"'$ROUTE'",
-   "iwconfig":"'$IWCONFIG'",
-   "assoclist":"'$ASSOCLIST'",
-   "hip_version":"'$HIP_VERSION'"}'
+   "hostname":"'$HOSTNAME'",\n
+   "client_ip":"'$REMOTE_ADDR'",\n
+   "os_release":"'$OS_RELEASE'",\n
+   "os_version":"'$OS_VERSION'",\n
+   "uptime":"'$UPTIME'",\n
+   "eth0":"'$IFCONFIG_eth0'",\n
+   "eth1":"'$IFCONFIG_eth1'",\n
+   "wlan0":"'$IFCONFIG_wlan0'",\n
+   "br-lan":"'$IFCONFIG_brlan'",\n
+   "route":"'$ROUTE'",\n
+   "iwconfig":"'$IWCONFIG'",\n
+   "assoclist":"'$ASSOCLIST'",\n
+   "hipd_version":"'$HIPD_VERSION'",\n
+   "hipfw_version":"'$HIPFW_VERSION'",\n
+   "pisacd_version":"'$PISACD_VERSION'",\n
+   "pisasd_version":"'$PISASD_VERSION'",\n
+   "hipconf_hi":"'$HIPCONF_HI'",\n
+   "hipconf_ha":"'$HIPCONF_HA'"}'
 
 parse_query callback
 if [ "$callback" ]; then
-    echo ${callback}'('${info_json}');'
+    echo -e ${callback}'('${info_json}');'
 else
-    echo ${info_json}
+    echo -e ${info_json}
 fi
-
-- 
This is the pisa developer mailing list. Please also subscribe to the main pisa 
list at:
//www.freelists.org/list/pisa

Other related posts:

  • » [pisa-src] r2580 - trunk/openwrt/router-configurations/pisa-testbed/usr/local/malocation/service/request_ap_info - Nicolai Viol