index d6cd93a9c9cd4cfea1a7b347151c0df22c2c2e7a..fd0f821e6c61ec616a268631e1831f392bdb1f88 100755 (executable)
#!/bin/sh
-# Start script for GOsa to be started via mozilla
+# Start script for GOsa to be started via gecko based browsers
+
+[ -r /etc/gosa/desktoprc ] && . /etc/gosa/desktoprc
+[ -r $HOME/.gosa-desktop ] && . $HOME/.gosa-desktop
url=""
-if [ $# -ne 1 ]; then
+if [ $# -ne 1 -a -z "$URL" ]; then
echo "Usage: $(basename $0) <URL>"
exit 1
fi
+if [ $# -ne 1 ]; then
+ url="$URL"
+else
+ url="$1"
+fi
+
+# What browser are we using?
+result=""
+for browser in iceweasel firefox mozilla; do
+ if which $browser &> /dev/null; then
+ result=$browser
+ break
+ fi
+done
+if [ -z "$result" ]; then
+ echo "No suitable browser found to launch GOsa. You'll need iceweasel, firefox or mozilla in your PATH!"
+ exit 1
+fi
+browser=$result
+
# Check for presence of gosa profile
-if [ ! -d $HOME/.mozilla/firefox/*.gosa ]; then
- firefox -CreateProfile gosa
- config=`echo $HOME/.mozilla/firefox/*.gosa/`
+if [ ! -d $HOME/.mozilla/$browser/*.gosa ]; then
+ echo "No browser profile found for GOsa - creating one..."
+ $browser -CreateProfile gosa
+ if [ "$browser" == "iceweasel" ]; then
+ config=`echo $HOME/.mozilla/firefox/*.gosa/`
+ else
+ config=`echo $HOME/.mozilla/$browser/*.gosa/`
+ fi
cat << EOF > $config/prefs.js
# Mozilla User Preferences
screenX="50"
screenY="25"
sizemode="normal"
- width="994"
- height="962" />
+ width="1000"
+ height="760" />
<RDF:Description RDF:about="chrome://help/content/help.xul">
<NC:persist RDF:resource="chrome://help/content/help.xul#help"/>
</RDF:Description>
# Start mozilla with GOsa profile
-firefox -P gosa
+$browser -P gosa