forked from PurpleI2P/i2pdbrowser
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
2.2 KiB
68 lines
2.2 KiB
8 years ago
|
#!/bin/sh
|
||
8 years ago
|
|
||
|
# Copyright (c) 2013-2017, The PurpleI2P Project
|
||
|
#
|
||
|
# This file is part of Purple i2pd project and licensed under BSD3
|
||
|
#
|
||
|
# See full license text in LICENSE file at top of project tree
|
||
|
|
||
8 years ago
|
arch=$(uname -m)
|
||
|
language=$(echo $LANG | cut -c-5 | sed s/_/-/g)
|
||
8 years ago
|
version="45.6.0esr"
|
||
8 years ago
|
application="firefox"
|
||
|
|
||
|
echo "This script prepearing $application $version for use with I2Pd"
|
||
|
|
||
|
file="$application-$version.tar.bz2"
|
||
8 years ago
|
url="https://ftp.mozilla.org/pub/$application/releases/$version/linux-$arch/$language/$file"
|
||
8 years ago
|
|
||
|
echo "Downloading $application..."
|
||
8 years ago
|
curl -L -f -# -O $url
|
||
8 years ago
|
if [ $? -ne 0 ]; then # Not found error, trying to cut language variable
|
||
|
language=$(echo $language | cut -c-2)
|
||
|
# re-create variable with cutted lang
|
||
8 years ago
|
url="https://ftp.mozilla.org/pub/$application/releases/$version/linux-$arch/$language/$file"
|
||
8 years ago
|
curl -L -f -# -O $url
|
||
8 years ago
|
fi
|
||
|
if [ ! -f $file ]; then
|
||
|
echo "Can't find downloaded file. Does FireFox support your system language?"
|
||
|
exit 1;
|
||
|
fi
|
||
|
echo "Extracting archive, please wait..."
|
||
|
tar xfj $file
|
||
|
rm $file
|
||
8 years ago
|
mv $application ../app
|
||
|
mkdir ../data
|
||
8 years ago
|
|
||
8 years ago
|
# Deleting some not needed files
|
||
8 years ago
|
rm ../app/crashreporter*
|
||
|
rm ../app/removed-files
|
||
|
rm ../app/run-mozilla.sh
|
||
|
rm ../app/update*
|
||
|
rm ../app/browser/blocklist.xml
|
||
|
rm -r ../app/dictionaries
|
||
8 years ago
|
# And edit some places
|
||
8 years ago
|
sed -i 's/Enabled=1/Enabled=0/g' ../app/application.ini
|
||
|
sed -i 's/ServerURL=.*/ServerURL=-/' ../app/application.ini
|
||
|
sed -i 's/Enabled=1/Enabled=0/g' ../app/webapprt/webapprt.ini
|
||
|
sed -i 's/ServerURL=.*/ServerURL=-/' ../app/webapprt/webapprt.ini
|
||
8 years ago
|
# Done!
|
||
|
|
||
8 years ago
|
echo "Downloading NoScript extension..."
|
||
8 years ago
|
curl -L -f -# -O https://addons.mozilla.org/firefox/downloads/latest/noscript/addon-722-latest.xpi
|
||
|
mv addon-722-latest.xpi ../app/browser/extensions/{73a6fe31-595d-460b-a920-fcc0f8843232}.xpi
|
||
8 years ago
|
|
||
|
echo "Adding standart configs..."
|
||
8 years ago
|
cp configs/* ../data/
|
||
8 years ago
|
|
||
8 years ago
|
echo '#!/bin/sh' > "../${application}-portable"
|
||
|
echo 'dir=${0%/*}' >> "../${application}-portable"
|
||
|
echo 'if [ "$dir" = "$0" ]; then' >> "../${application}-portable"
|
||
|
echo ' dir="."' >> "../${application}-portable"
|
||
|
echo 'fi' >> "../${application}-portable"
|
||
|
echo 'cd "$dir/app"' >> "../${application}-portable"
|
||
|
echo './firefox -profile ../data -no-remote' >> "../${application}-portable"
|
||
8 years ago
|
|
||
8 years ago
|
chmod +x "../$application-portable"
|
||
8 years ago
|
echo ... finished
|