[izpack-changes] izpack-src/src/dist-files start.sh,1.1,1.1.2.1

eppelman nobody at sheep.berlios.de
Tue Apr 25 16:47:05 CEST 2006


Update of /cvsroot/izpack/izpack-src/src/dist-files
In directory sheep:/tmp/cvs-serv11805/src/dist-files

Modified Files:
      Tag: branch-3-8
	start.sh 
Log Message:
fixed lookForRunningGecko() - function to work with current firefox releases too. Unfortunately the -remote ping() always returns 0 even if there is no local running FF.

Index: start.sh
===================================================================
RCS file: /cvsroot/izpack/izpack-src/src/dist-files/start.sh,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -d -r1.1 -r1.1.2.1
--- start.sh	9 Sep 2005 07:15:38 -0000	1.1
+++ start.sh	25 Apr 2006 14:47:29 -0000	1.1.2.1
@@ -60,19 +60,28 @@
 
 function lookForRunningGecko(){
   if command -v firefox &>/dev/null; then
-    if command firefox -remote "ping()" &>/dev/null; then
-      echo firefox # firefox -remote \"openurl("$1",new-tab)\"
+    tempfile=`mktemp`
+  	
+    firefox -remote "ping()" 2> $tempfile
+    
+  	if [ -s $tempfile ]; then
+      rm $tempfile
+      echo "none" # is not running :-)
+      return 1
+  	else
+  	  rm $tempfile      
+  	  echo firefox # is running :-)
       return 0
-    fi
+  	fi    
   fi    # firefox "$1"
   if command -v mozilla &>/dev/null; then
     #if mozilla -remote "ping()" 
     if command mozilla -remote "ping()" &>/dev/null; then
-      echo mozilla # firefox -remote \"openurl("$1",new-tab)\"
+      echo mozilla # is running :-)
       return 0
     fi
   fi
-  echo none
+  echo "none"
   
   return 1
 }




More information about the izpack-changes mailing list