add explicit platform check to wwwfind tool
authorkleing
Sat, 21 Nov 2009 17:04:03 +1100
changeset 33829 7277fa74120a
parent 33828 e7289ca31aa0
child 33830 1b634d37aa64
add explicit platform check to wwwfind tool explicit platform check to avoid calling external programs with strange parameters
src/Tools/WWW_Find/lib/Tools/wwwfind
--- a/src/Tools/WWW_Find/lib/Tools/wwwfind	Sat Nov 21 16:56:53 2009 +1100
+++ b/src/Tools/WWW_Find/lib/Tools/wwwfind	Sat Nov 21 17:04:03 2009 +1100
@@ -33,6 +33,18 @@
   exit 2
 }
 
+function checkplatform()
+{
+  PLAT=$(uname -s)
+  case "$PLAT" in
+    Linux)
+      ;;
+    *)
+      fail "Platform $PLAT currently not supported by $PRG component."
+      ;;
+  esac
+}
+
 function kill_by_port () {
   IPADDR='[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*'
   PID=$(netstat -nltp 2>/dev/null \
@@ -46,6 +58,10 @@
   netstat -latp 2>/dev/null | grep ":$1 "
 }
 
+## platform support check
+
+checkplatform
+
 ## process command line
 
 case "$1" in