components, modules: change deprecated replace flag
[conkeror.git] / debian / bin / conkeror
blobea4c7740e646ea8e911c451a7c25c37a30fb270c
1 #!/bin/sh
2 # Wrapper around xulrunner/firefox to start the xulrunner application conkeror
3 # Written by Axel Beckert <abe@deuxchevaux.org> for the Debian Project
5 # Find an appropriate xulrunner binary
6 XULRUNNER=''
8 # *sigh* No more xulrunner since iceweasel 30
9 if [ -x /usr/bin/iceweasel ]; then
10 XULRUNNER="/usr/bin/iceweasel -app"
14 if [ -z "$XULRUNNER" ]; then
15 # Due to http://bugs.debian.org/683157 we have to skip xulrunner-14.0
16 for version in `LC_ALL=C seq 30 -1 15` `LC_ALL=C seq 13 -1 5` 2 1.9.2 1.9.1; do
17 for subversion in $version $version.0; do
18 XRTMP=`which xulrunner-$subversion`
19 if [ -n "$XRTMP" -a -x "$XRTMP" ]; then
20 XULRUNNER=$XRTMP
21 break 2
23 done
24 done
27 # Try firefox if no xulrunner can be found
28 if [ -z "$XULRUNNER" ]; then
29 FFTMP=`which firefox`
30 if [ -n "$FFTMP" -a -x "$FFTMP" ]; then
31 echo "xulrunner not found, trying firefox instead." 1>&2
32 XULRUNNER="$FFTMP -app"
36 if [ -z "$XULRUNNER" ]; then
37 echo "xulrunner version 1.9.1 (or iceweasel/firefox version 3.5) or newer required, but not found. Bailing out." 1>&2
38 exit 1;
41 if [ "$*" = "--help" ]; then
42 errormsg="`exec $XULRUNNER /usr/share/conkeror/application.ini \"$@\" 2>&1`"
43 echo "$errormsg" | sed -e "s:/[^ ]*/xulrunner-bin:$0:; /-\(width\|height\)/d" 1>&2
44 else
45 exec $XULRUNNER /usr/share/conkeror/application.ini "$@"