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

  • From: Nicolai Viol <Nicolai.Viol@xxxxxxxxxxxxxxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Thu, 19 May 2011 18:41:30 +0200

Author: viol
Date: Thu May 19 18:41:29 2011
New Revision: 2581

Log:
added process watch list for hip and pisa

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 20:38:16 2011        (r2580)
+++ 
trunk/openwrt/router-configurations/pisa-testbed/usr/local/malocation/service/request_ap_info
       Thu May 19 18:41:29 2011        (r2581)
@@ -14,15 +14,34 @@
 IWCONFIG=$(iwconfig wlan0 | tr '\n' ';')
 ASSOCLIST=$(iw dev wlan0 station dump | 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/hipd ]; then
+   HIPD_VERSION=$(hipd -V | head -n 1 | tr '\n' ';')
+   HIPD=$(cat $PS | grep -q hipd)
+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' ';')
+   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
 
+PROCESSES="hipd hipfw pisacd pisasd"
+PS_LIST=$(ps)
+PS=""
+for p in $PROCESSES; do
+   if echo "$PS_LIST" | grep -q "$p"; then
+      PS="$p;$PS"
+   fi
+done
+
 info_json='{
    "hostname":"'$HOSTNAME'",\n
    "client_ip":"'$REMOTE_ADDR'",\n
@@ -36,6 +55,7 @@
    "route":"'$ROUTE'",\n
    "iwconfig":"'$IWCONFIG'",\n
    "assoclist":"'$ASSOCLIST'",\n
+   "ps":"'$PS'",\n
    "hipd_version":"'$HIPD_VERSION'",\n
    "hipfw_version":"'$HIPFW_VERSION'",\n
    "pisacd_version":"'$PISACD_VERSION'",\n
-- 
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] r2581 - trunk/openwrt/router-configurations/pisa-testbed/usr/local/malocation/service/request_ap_info - Nicolai Viol