work around profile creation issues in a recent Firefox versions with an ugly hack
This commit is contained in:
parent
2e97d33757
commit
e738e875bb
|
|
@ -3,13 +3,6 @@ set -e
|
|||
COMMAND="$1"
|
||||
echo "$COMMAND"
|
||||
|
||||
# If no profile ...
|
||||
if [ ! -d "$HOME/.mozilla" ]; then
|
||||
# create the default Firefox profile and put some settings there
|
||||
firefox -CreateProfile default
|
||||
mv $HOME/user.js `find $HOME/.mozilla/firefox -type d | grep .default`
|
||||
fi
|
||||
|
||||
OPENVPN_CONF='/etc/openvpn/openvpn.conf'
|
||||
if [ -f "$OPENVPN_CONF" ]; then
|
||||
"$HOME/start-openvpn-blocking.sh" "$OPENVPN_CONF"
|
||||
|
|
@ -31,5 +24,24 @@ if [ ! -z ${ASSERT_COUNTRY+x} ]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
# Start firefox
|
||||
# If no profile ...
|
||||
if [ $COMMAND == "firefox" ]; then
|
||||
# create the default Firefox profile and put some settings there
|
||||
firefox &
|
||||
FIREFOX_PID=$!
|
||||
# Since some recent Firefox version, calling CreateProfile and copying
|
||||
# user.js stopped working on the first use for reasons I could not find on
|
||||
# Google and do not frankly care about. This is the workaround
|
||||
set +e
|
||||
while [ `find $HOME/.mozilla/firefox -type f | grep prefs.js | wc -l` == "0" ];
|
||||
do
|
||||
echo "... waiting for Firefox to start the first time"
|
||||
sleep 1
|
||||
done
|
||||
set -e
|
||||
echo "killing Firefox and copying settings"
|
||||
kill $FIREFOX_PID
|
||||
mv $HOME/user.js `find $HOME/.mozilla/firefox -maxdepth 1 -type d | grep .default-release`
|
||||
fi
|
||||
|
||||
$COMMAND
|
||||
|
|
|
|||
Loading…
Reference in New Issue