put some more logic into MOZ_APP_LAUNCHER setting
authorWolfgang Rosenauer <wr@rosenauer.org>
Thu, 13 Jan 2011 09:44:19 +0100
changeset 212 f25759227036
parent 211 aef7c16cb0e5
child 213 b2978eba3a92
put some more logic into MOZ_APP_LAUNCHER setting
MozillaFirefox/mozilla.sh.in
--- a/MozillaFirefox/mozilla.sh.in	Wed Jan 12 23:55:42 2011 +0100
+++ b/MozillaFirefox/mozilla.sh.in	Thu Jan 13 09:44:19 2011 +0100
@@ -20,7 +20,7 @@
 # Portions created by the Initial Developer are Copyright (C) 1998
 # the Initial Developer. All Rights Reserved.
 #
-# Contributor(s): 
+# Contributor(s):
 #    Wolfgang Rosenauer <wolfgang.rosenauer@suse.de>
 #                       <wr@rosenauer.org>
 #
@@ -38,7 +38,7 @@
 #
 # ***** END LICENSE BLOCK *****
 
-## 
+##
 ## Usage:
 ##
 ## $ mozilla [args]
@@ -59,7 +59,16 @@
 MOZ_APPNAME="%APPNAME"
 MOZ_PROGRAM="$MOZ_DIST_LIB/$MOZ_APPNAME"
 
-export MOZ_APP_LAUNCHER="$MOZ_DIST_LIB/$MOZ_APPNAME.sh"
+MOZ_APP_LAUNCHER="$MOZ_DIST_LIB/$MOZ_APPNAME.sh"
+if [ "$0" = "$MOZ_APP_LAUNCHER" ]; then
+  [ -h "/usr/bin/$MOZ_APPNAME" ] && \
+   _link=$(readlink -f "/usr/bin/$MOZ_APPNAME")
+  if [ "$_link" = "$MOZ_APP_LAUNCHER" ]; then
+    export MOZ_APP_LAUNCHER="/usr/bin/$MOZ_APPNAME"
+  fi
+else
+  export MOZ_APP_LAUNCHER="/usr/bin/$MOZ_APPNAME"
+fi
 
 mozilla_lib=`file $MOZ_PROGRAM`
 LIB=lib