2015-03-21 20:04:17 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Script to install Firefox on GNU/Linux
|
2015-10-06 19:50:14 +02:00
|
|
|
# Created by clamsawd (clamsawd@openmailbox.org)
|
2015-03-21 20:04:17 +01:00
|
|
|
# Licensed by GPL v.2
|
2016-01-08 22:09:39 +01:00
|
|
|
# Last update: 08-01-2015
|
2015-03-21 20:04:17 +01:00
|
|
|
# --------------------------------------
|
2016-01-08 22:09:39 +01:00
|
|
|
VERSION="3.0.1"
|
2015-03-21 20:04:17 +01:00
|
|
|
|
|
|
|
# Check if 'user' is 'root'
|
|
|
|
user=$(whoami)
|
|
|
|
if [ "$user" == "root" ] ; then
|
|
|
|
echo "OK" > /dev/null
|
|
|
|
else
|
|
|
|
echo "You must be root!"
|
|
|
|
exit 0
|
|
|
|
fi
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
# Detect "kernel" name
|
|
|
|
KERNEL=$(uname -s)
|
|
|
|
if [ $KERNEL == "Linux" ]; then
|
2015-11-19 16:14:40 +01:00
|
|
|
KERNEL="linux"
|
2015-03-21 20:04:17 +01:00
|
|
|
else
|
|
|
|
echo "Unsupported OS ($KERNEL)"
|
|
|
|
exit 0
|
|
|
|
fi
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
# Create Mozilla Firefox shortcut after of install it.
|
|
|
|
function create_firefox_icon(){
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2016-01-08 22:09:39 +01:00
|
|
|
cp -rf /opt/firefox/browser/icons/mozicon128.png /usr/share/icons/hicolor/16x16/apps/firefox.png
|
|
|
|
cp -rf /opt/firefox/browser/icons/mozicon128.png /usr/share/icons/hicolor/32x32/apps/firefox.png
|
|
|
|
cp -rf /opt/firefox/browser/icons/mozicon128.png /usr/share/icons/hicolor/48x48/apps/firefox.png
|
|
|
|
cp -rf /opt/firefox/browser/icons/mozicon128.png /usr/share/icons/hicolor/64x64/apps/firefox.png
|
|
|
|
cp -rf /opt/firefox/browser/icons/mozicon128.png /usr/share/icons/hicolor/128x128//apps/firefox.png
|
2015-10-14 18:15:33 +02:00
|
|
|
echo "[Desktop Entry]" > /usr/share/applications/firefox.desktop
|
|
|
|
#echo "Encoding=UTF-8" >> /usr/share/applications/firefox.desktop
|
|
|
|
echo "Name=Mozilla Firefox" >> /usr/share/applications/firefox.desktop
|
|
|
|
echo "Comment=Browse the World Wide Web" >> /usr/share/applications/firefox.desktop
|
|
|
|
echo "GenericName=Web Browser" >> /usr/share/applications/firefox.desktop
|
|
|
|
echo "X-GNOME-FullName=Mozilla Firefox" >> /usr/share/applications/firefox.desktop
|
|
|
|
echo "Exec=firefox %u" >> /usr/share/applications/firefox.desktop
|
|
|
|
echo "Terminal=false" >> /usr/share/applications/firefox.desktop
|
|
|
|
echo "X-MultipleArgs=false" >> /usr/share/applications/firefox.desktop
|
|
|
|
echo "Type=Application" >> /usr/share/applications/firefox.desktop
|
2016-01-08 22:09:39 +01:00
|
|
|
echo "Icon=firefox" >> /usr/share/applications/firefox.desktop
|
2015-10-14 18:15:33 +02:00
|
|
|
echo "Categories=Network;WebBrowser;" >> /usr/share/applications/firefox.desktop
|
|
|
|
#echo "StartupWMClass=Firefox-bin" >> /usr/share/applications/firefox.desktop
|
|
|
|
echo "StartupNotify=true" >> /usr/share/applications/firefox.desktop
|
2015-03-21 20:04:17 +01:00
|
|
|
chmod 755 /usr/share/applications/firefox.desktop
|
2015-10-14 18:15:33 +02:00
|
|
|
echo " <-Finished->"
|
|
|
|
exit
|
2015-03-21 20:04:17 +01:00
|
|
|
}
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
# Install Firefox using 'tar' command and
|
|
|
|
# initialize the 'create_firefox_icon' function.
|
2015-10-06 19:50:14 +02:00
|
|
|
function install_firefox(){
|
2015-03-21 20:04:17 +01:00
|
|
|
|
2015-10-14 18:15:33 +02:00
|
|
|
echo ""
|
|
|
|
echo " <-Downloading Mozilla Firefox->"
|
2015-03-21 20:04:17 +01:00
|
|
|
cd /tmp/
|
2015-11-19 16:14:40 +01:00
|
|
|
$APP_DOWNLOAD $SERVER
|
2015-10-14 18:15:33 +02:00
|
|
|
echo " <-Installing Mozilla Firefox->"
|
2015-11-19 16:14:40 +01:00
|
|
|
tar jxvf $RELEASE.tar.bz2 -C /opt/
|
2015-03-21 20:04:17 +01:00
|
|
|
rm -rf /usr/bin/firefox
|
|
|
|
ln -s /opt/firefox/firefox /usr/bin/firefox
|
|
|
|
chmod 755 -R /opt/firefox/
|
2015-11-19 16:14:40 +01:00
|
|
|
rm -rf /tmp/$RELEASE.tar.bz2
|
2015-03-21 20:04:17 +01:00
|
|
|
create_firefox_icon
|
|
|
|
}
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
# Define the complete URL of selected firefox package, show
|
|
|
|
# the selected previous options to confirm and will initialize
|
2015-10-06 19:50:14 +02:00
|
|
|
# the install ('install_firefox' function).
|
2015-03-21 20:04:17 +01:00
|
|
|
function step5_install_firefox(){
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-11-19 16:14:40 +01:00
|
|
|
SERVER="https://download.mozilla.org/?product=$RELEASE&os=$ARCH&lang=$LANGUAGE"
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
clear
|
2015-10-14 18:15:33 +02:00
|
|
|
echo ""
|
2015-11-19 16:14:40 +01:00
|
|
|
echo "firefox-install v$VERSION"
|
2016-01-08 22:09:39 +01:00
|
|
|
echo "----------------------"
|
2015-11-19 16:14:40 +01:00
|
|
|
echo ""
|
2015-10-14 18:15:33 +02:00
|
|
|
echo "[Step 5/5] Check your selected installation:"
|
|
|
|
echo ""
|
|
|
|
echo "Install: Mozilla Firefox"
|
2015-11-19 16:14:40 +01:00
|
|
|
echo "Package: $RELEASE"
|
2015-10-14 18:15:33 +02:00
|
|
|
echo "Language: $LANGUAGE"
|
2015-11-19 16:14:40 +01:00
|
|
|
echo "Arch: $ARCH_NAME"
|
2015-10-14 18:15:33 +02:00
|
|
|
echo "Directory: /opt/firefox/"
|
|
|
|
echo ""
|
2015-11-19 16:14:40 +01:00
|
|
|
echo "Apps: $NAME_APP (download), tar (unpack) "
|
2015-10-14 18:15:33 +02:00
|
|
|
echo ""
|
2015-11-19 16:14:40 +01:00
|
|
|
echo -n "(default: y) Is correct? (y/n/q); " ; read VAREND
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
if [ "${VAREND:-NO_VALUE}" == "NO_VALUE" -o "$VAREND" == "yes" -o "$VAREND" == "y" ] ; then
|
2015-10-06 19:50:14 +02:00
|
|
|
install_firefox
|
2015-03-21 20:04:17 +01:00
|
|
|
elif [ "$VAREND" == "no" -o "$VAREND" == "n" ] ; then
|
2015-11-19 16:14:40 +01:00
|
|
|
step1_choose_version
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
elif [ "$VAREND" == "q" -o "$VAREND" == "quit" ] ; then
|
|
|
|
exit
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
else
|
2015-10-14 18:15:33 +02:00
|
|
|
clear
|
|
|
|
echo ""
|
|
|
|
echo "Invalid option, please, choose any available option"
|
|
|
|
echo ""
|
|
|
|
echo -n "Press 'ENTER' to return "
|
2015-03-21 20:04:17 +01:00
|
|
|
read yesorno
|
|
|
|
step5_install_firefox
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2015-10-14 18:15:33 +02:00
|
|
|
# Check if 'wget', 'aria2c' & 'axel' are installed,
|
2015-03-21 20:04:17 +01:00
|
|
|
# define the corresponding variable and initialize the
|
|
|
|
# 'step4_choose_app_download' function.
|
|
|
|
function check_downloaders_on_system() {
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
wget --help > /dev/null
|
|
|
|
if [ "$?" -eq 0 ] ; then
|
2015-11-19 16:14:40 +01:00
|
|
|
WGET="Available"
|
2015-03-21 20:04:17 +01:00
|
|
|
else
|
2015-11-19 16:14:40 +01:00
|
|
|
WGET="Not available"
|
2015-03-21 20:04:17 +01:00
|
|
|
fi
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
aria2c --help > /dev/null
|
|
|
|
if [ "$?" -eq 0 ] ; then
|
2015-11-19 16:14:40 +01:00
|
|
|
ARIA2C="Available"
|
2015-03-21 20:04:17 +01:00
|
|
|
else
|
2015-11-19 16:14:40 +01:00
|
|
|
ARIA2C="Not available"
|
2015-10-14 18:15:33 +02:00
|
|
|
fi
|
2015-03-21 20:04:17 +01:00
|
|
|
|
|
|
|
axel --help > /dev/null
|
|
|
|
if [ "$?" -eq 0 ] ; then
|
2015-11-19 16:14:40 +01:00
|
|
|
AXEL="Available"
|
2015-03-21 20:04:17 +01:00
|
|
|
else
|
2015-11-19 16:14:40 +01:00
|
|
|
AXEL="Not available"
|
2015-10-14 18:15:33 +02:00
|
|
|
fi
|
2015-03-21 20:04:17 +01:00
|
|
|
step4_choose_app_download
|
|
|
|
}
|
|
|
|
|
|
|
|
# Check if exist a previous installation of firefox and
|
|
|
|
# allows overwrite it, uninstall it or exit to cancel.
|
|
|
|
# Initialize the 'step1_choose_version' function too.
|
|
|
|
function check_other_installs_on_system(){
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
if [ -d /opt/firefox/ ]; then
|
|
|
|
clear
|
2015-10-14 18:15:33 +02:00
|
|
|
echo ""
|
|
|
|
echo "Detected a previous installation of Firefox"
|
|
|
|
echo "Do you want to overwrite or uninstall the current version?"
|
|
|
|
echo ""
|
|
|
|
echo "(1) - overwrite"
|
|
|
|
echo "(2) - uninstall"
|
|
|
|
echo "(3) - quit (q)"
|
|
|
|
echo ""
|
|
|
|
echo -n "(Default: overwrite) Choose an option; " ; read INST
|
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
if [ "${INST:-NO_VALUE}" == "NO_VALUE" ] ; then
|
2015-11-19 16:14:40 +01:00
|
|
|
step1_choose_version
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
elif [ "$INST" == "1" -o "$INST" == "overwrite" ] ; then
|
2015-11-19 16:14:40 +01:00
|
|
|
step1_choose_version
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
elif [ "$INST" == "2" -o "$INST" == "uninstall" ] ; then
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
clear
|
2015-10-14 18:15:33 +02:00
|
|
|
echo ""
|
|
|
|
echo "Uninstalling Firefox, please wait..."
|
|
|
|
echo ""
|
2015-03-21 20:04:17 +01:00
|
|
|
sleep 5
|
|
|
|
rm -rf /usr/bin/firefox
|
|
|
|
rm -rf /usr/share/applications/firefox.desktop
|
|
|
|
rm -rf /opt/firefox/
|
2015-10-14 18:15:33 +02:00
|
|
|
echo "Done!"
|
|
|
|
echo ""
|
2015-03-21 20:04:17 +01:00
|
|
|
exit
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
elif [ "$INST" == "3" -o "$INST" == "quit" -o "$INST" == "q" ]; then
|
|
|
|
exit
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
else
|
2015-10-14 18:15:33 +02:00
|
|
|
clear
|
|
|
|
echo ""
|
|
|
|
echo "Invalid option, please, choose any available option"
|
|
|
|
echo ""
|
|
|
|
echo -n "Press 'ENTER' to return "
|
2015-03-21 20:04:17 +01:00
|
|
|
read notoption
|
|
|
|
check_other_installs_on_system
|
|
|
|
fi
|
|
|
|
else
|
2015-11-19 16:14:40 +01:00
|
|
|
step1_choose_version
|
2015-03-21 20:04:17 +01:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# Define the variable 'APP_DOWNLOAD' and
|
2015-10-06 19:50:14 +02:00
|
|
|
# initialize the 'step5_install_firefox'
|
2015-03-21 20:04:17 +01:00
|
|
|
# function.
|
|
|
|
function step4_choose_app_download(){
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
clear
|
2015-10-14 18:15:33 +02:00
|
|
|
echo ""
|
2015-11-19 16:14:40 +01:00
|
|
|
echo "firefox-install v$VERSION"
|
2016-01-08 22:09:39 +01:00
|
|
|
echo "----------------------"
|
2015-11-19 16:14:40 +01:00
|
|
|
echo ""
|
2015-10-14 18:15:33 +02:00
|
|
|
echo "[ Step 4/5 (App to download) ]"
|
|
|
|
echo ""
|
|
|
|
echo "Available apps to download:"
|
|
|
|
echo ""
|
|
|
|
echo "(1) - wget ($WGET)"
|
|
|
|
echo "(2) - aria2c ($ARIA2C)"
|
|
|
|
echo "(3) - axel ($AXEL)"
|
|
|
|
echo ""
|
|
|
|
echo "(q) - quit"
|
|
|
|
echo ""
|
2015-03-21 20:04:17 +01:00
|
|
|
APP=0
|
2015-11-19 16:14:40 +01:00
|
|
|
echo -n "(Default: wget) Choose an option; " ; read APP
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-11-19 16:14:40 +01:00
|
|
|
if [ "$APP" == "1" -o "$APP" == "wget" -o "${APP:-NO_VALUE}" == "NO_VALUE" ] ; then
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
# Check if 'wget' is available using the variable
|
|
|
|
# defined in 'check_downloaders_on_system' function.
|
|
|
|
if [ "$WGET" == "Available" ]; then
|
2015-11-19 16:14:40 +01:00
|
|
|
APP_DOWNLOAD="wget -O $RELEASE.tar.bz2 -c"
|
|
|
|
NAME_APP="wget"
|
2015-10-06 19:50:14 +02:00
|
|
|
step5_install_firefox
|
2015-03-21 20:04:17 +01:00
|
|
|
else
|
|
|
|
clear
|
2015-10-14 18:15:33 +02:00
|
|
|
echo ""
|
|
|
|
echo "'wget' is not available in your system"
|
|
|
|
echo ""
|
|
|
|
echo -n "Press 'ENTER' to return "
|
2015-03-21 20:04:17 +01:00
|
|
|
read not
|
|
|
|
step4_choose_app_download
|
|
|
|
fi
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
elif [ "$APP" == "2" -o "$APP" == "aria2c" ] ; then
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
# Check if 'aria2c' is available using the variable
|
|
|
|
# defined in 'check_downloaders_on_system' function.
|
|
|
|
if [ "$ARIA2C" == "Available" ]; then
|
2015-11-19 16:14:40 +01:00
|
|
|
APP_DOWNLOAD="aria2c --check-certificate=false -o $RELEASE.tar.bz2"
|
|
|
|
NAME_APP="aria2c"
|
2015-10-06 19:50:14 +02:00
|
|
|
step5_install_firefox
|
2015-03-21 20:04:17 +01:00
|
|
|
else
|
|
|
|
clear
|
2015-10-14 18:15:33 +02:00
|
|
|
echo ""
|
|
|
|
echo "'aria2c' is not available in your system"
|
|
|
|
echo ""
|
|
|
|
echo -n "Press 'ENTER' to return "
|
2015-03-21 20:04:17 +01:00
|
|
|
read not
|
|
|
|
step4_choose_app_download
|
|
|
|
fi
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
elif [ "$APP" == "3" -o "$APP" == "axel" ] ; then
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
# Check if 'axel' is available using the variable
|
|
|
|
# defined in 'check_downloaders_on_system' function.
|
|
|
|
if [ "$AXEL" == "Available" ]; then
|
2015-11-19 16:14:40 +01:00
|
|
|
APP_DOWNLOAD="axel -o $RELEASE.tar.bz2"
|
|
|
|
NAME_APP="axel"
|
2015-10-06 19:50:14 +02:00
|
|
|
step5_install_firefox
|
2015-03-21 20:04:17 +01:00
|
|
|
else
|
|
|
|
clear
|
2015-10-14 18:15:33 +02:00
|
|
|
echo ""
|
|
|
|
echo "'axel' is not available in your system"
|
|
|
|
echo ""
|
|
|
|
echo -n "Press 'ENTER' to return "
|
2015-03-21 20:04:17 +01:00
|
|
|
read not
|
|
|
|
step4_choose_app_download
|
|
|
|
fi
|
2015-10-06 19:50:14 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
elif [ "$APP" == "q" -o "$APP" == "quit" ] ; then
|
|
|
|
exit
|
|
|
|
else
|
2015-10-14 18:15:33 +02:00
|
|
|
clear
|
|
|
|
echo ""
|
|
|
|
echo "Invalid option, please, choose any available app"
|
|
|
|
echo ""
|
|
|
|
echo -n "Press 'ENTER' to return "
|
2015-03-21 20:04:17 +01:00
|
|
|
read notapp
|
|
|
|
step4_choose_app_download
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# Define the variable 'AR' and initialize
|
|
|
|
# the 'check_downloaders_on_system' function.
|
|
|
|
function step3_choose_arch(){
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
clear
|
2015-10-14 18:15:33 +02:00
|
|
|
echo ""
|
2015-11-19 16:14:40 +01:00
|
|
|
echo "firefox-install v$VERSION"
|
2016-01-08 22:09:39 +01:00
|
|
|
echo "----------------------"
|
2015-11-19 16:14:40 +01:00
|
|
|
echo ""
|
2015-10-14 18:15:33 +02:00
|
|
|
echo "[ Step 3/5 (Arch) ]"
|
|
|
|
echo ""
|
|
|
|
echo "Available Arch:"
|
|
|
|
echo ""
|
2015-11-19 16:14:40 +01:00
|
|
|
echo "(1) - 32 bits (linux)"
|
|
|
|
echo "(2) - 64 bits (linux64)"
|
2015-10-14 18:15:33 +02:00
|
|
|
echo ""
|
|
|
|
echo "(q) - quit"
|
|
|
|
echo ""
|
|
|
|
echo -n "(Default: autodetect) Choose an option; " ; read AR
|
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
if [ "${AR:-NO_VALUE}" == "NO_VALUE" ] ; then
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
# Detect the arch of the system if variable
|
|
|
|
# 'AR' is empty.
|
|
|
|
archs=`uname -m`
|
|
|
|
case "$archs" in
|
|
|
|
i?86)
|
2015-11-19 16:14:40 +01:00
|
|
|
ARCH="linux"
|
|
|
|
ARCH_NAME="x86"
|
2015-03-21 20:04:17 +01:00
|
|
|
check_downloaders_on_system
|
|
|
|
;;
|
|
|
|
x86_64)
|
2015-11-19 16:14:40 +01:00
|
|
|
ARCH="linux64"
|
|
|
|
ARCH_NAME="x86_64"
|
2015-03-21 20:04:17 +01:00
|
|
|
check_downloaders_on_system
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Unsupported Arquitecture ($archs)"
|
|
|
|
exit 0
|
|
|
|
esac
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
elif [ "$AR" == "1" -o "$AR" == "32" ] ; then
|
2015-11-19 16:14:40 +01:00
|
|
|
ARCH="linux"
|
|
|
|
ARCH_NAME="x86"
|
2015-03-21 20:04:17 +01:00
|
|
|
check_downloaders_on_system
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
elif [ "$AR" == "2" -o "$AR" == "64" ] ; then
|
2015-11-19 16:14:40 +01:00
|
|
|
ARCH="linux64"
|
|
|
|
ARCH_NAME="x86_64"
|
2015-03-21 20:04:17 +01:00
|
|
|
check_downloaders_on_system
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
elif [ "$AR" == "q" -o "$AR" == "quit" ] ; then
|
|
|
|
exit
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
else
|
2015-10-14 18:15:33 +02:00
|
|
|
clear
|
|
|
|
echo ""
|
|
|
|
echo "Invalid option, please, choose any available arch"
|
|
|
|
echo ""
|
|
|
|
echo -n "Press 'ENTER' to return "
|
2015-03-21 20:04:17 +01:00
|
|
|
read notarch
|
|
|
|
step3_choose_arch
|
|
|
|
fi
|
|
|
|
}
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
# Define the variable 'LANGUAGE' and initialize the
|
|
|
|
# 'step3_choose_arch' funtion.
|
|
|
|
function step2_choose_language(){
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
FILE_LANGUAGES=/tmp/firefox-languages
|
|
|
|
clear
|
2015-10-14 18:15:33 +02:00
|
|
|
echo ""
|
2015-11-19 16:14:40 +01:00
|
|
|
echo "firefox-install v$VERSION"
|
2016-01-08 22:09:39 +01:00
|
|
|
echo "----------------------"
|
2015-11-19 16:14:40 +01:00
|
|
|
echo ""
|
2015-10-14 18:15:33 +02:00
|
|
|
echo "[ Step 2/5 (Language) ]"
|
|
|
|
echo ""
|
|
|
|
echo "Available languages:"
|
|
|
|
echo ""
|
|
|
|
echo "[ach] [af] [an] [ar] [as] [ast] [be]" > $FILE_LANGUAGES
|
|
|
|
echo "[bg] [bn-BD] [bn-IN] [br] [bs] [ca]" >> $FILE_LANGUAGES
|
|
|
|
echo "[cs] [csb] [cy] [da] [de] [el] [en-GB]" >> $FILE_LANGUAGES
|
|
|
|
echo "[en-US] [en-ZA] [eo] [es-AR] [es-CL]" >> $FILE_LANGUAGES
|
|
|
|
echo "[es-ES] [es-MX] [et] [eu] [fa] [ff] [fi]" >> $FILE_LANGUAGES
|
|
|
|
echo "[fr] [fy-NL] [ga-IE] [gd] [gl] [gu-IN]" >> $FILE_LANGUAGES
|
|
|
|
echo "[he] [hi-IN] [hr] [hu] [hy-AM] [id]" >> $FILE_LANGUAGES
|
|
|
|
echo "[is] [it] [ja] [kk] [km] [kn] [ko] [ku]" >> $FILE_LANGUAGES
|
|
|
|
echo "[lij] [lt] [lv] [mai] [mk] [ml] [mr]" >> $FILE_LANGUAGES
|
|
|
|
echo "[ms] [nb-NO] [nl] [nn-NO] [or] [pa-IN]" >> $FILE_LANGUAGES
|
|
|
|
echo "[pl] [pt-BR] [pt-PT] [rm] [ro] [ru]" >> $FILE_LANGUAGES
|
|
|
|
echo "[si] [sk] [sl] [son] [sq] [sr] [sv-SE]" >> $FILE_LANGUAGES
|
|
|
|
echo "[sw] [ta] [te] [th] [tr] [uk] [vi] [xh]" >> $FILE_LANGUAGES
|
|
|
|
echo "[xpi] [zh-CN] [zh-TW] [zu]" >> $FILE_LANGUAGES
|
2015-03-21 20:04:17 +01:00
|
|
|
cat $FILE_LANGUAGES
|
2015-10-14 18:15:33 +02:00
|
|
|
echo ""
|
|
|
|
echo -n "(Default: en-US) Type the language; " ; read LANG
|
2015-03-21 20:04:17 +01:00
|
|
|
COUNT=1
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
# Check if the variable 'LANG' is empty.
|
|
|
|
if [ "${LANG:-NO_VALUE}" != "NO_VALUE" ] ; then
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
# Check if the variable 'LANG' is valid.
|
|
|
|
while [ $COUNT -le 10 ]; do
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
LANGUAGE_VAR=`cat $FILE_LANGUAGES | grep $LANG | cut -d "[" -f $COUNT | cut -d "]" -f 1`
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
if [ "$LANGUAGE_VAR" == "$LANG" ]; then
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-11-19 16:14:40 +01:00
|
|
|
LANGUAGE="$LANG"
|
2015-03-21 20:04:17 +01:00
|
|
|
step3_choose_arch
|
2015-10-14 18:15:33 +02:00
|
|
|
|
|
|
|
else
|
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
COUNT=`expr $COUNT + 1`
|
|
|
|
fi
|
|
|
|
done
|
2015-10-14 18:15:33 +02:00
|
|
|
|
|
|
|
clear
|
|
|
|
echo ""
|
|
|
|
echo "Language '$LANG' is not valid, please, type any available language"
|
|
|
|
echo ""
|
|
|
|
echo -n "Press 'ENTER' to return "
|
2015-03-21 20:04:17 +01:00
|
|
|
read notlang
|
|
|
|
step2_choose_language
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
else
|
|
|
|
LANGUAGE=en-US
|
|
|
|
step3_choose_arch
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
function step1_choose_version(){
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
clear
|
2015-10-14 18:15:33 +02:00
|
|
|
echo ""
|
2015-11-19 16:14:40 +01:00
|
|
|
echo "firefox-install v$VERSION"
|
2016-01-08 22:09:39 +01:00
|
|
|
echo "----------------------"
|
2015-11-19 16:14:40 +01:00
|
|
|
echo ""
|
2015-10-14 18:15:33 +02:00
|
|
|
echo "[ Step 1/5 (Version) ]"
|
|
|
|
echo ""
|
|
|
|
echo "Available Versions:"
|
|
|
|
echo ""
|
2015-11-19 16:14:40 +01:00
|
|
|
echo "(1) - firefox-esr-latest (ESR)"
|
|
|
|
echo "(2) - firefox-latest (stable)"
|
|
|
|
echo "(3) - firefox-beta-latest (beta)"
|
2015-10-14 18:15:33 +02:00
|
|
|
echo ""
|
|
|
|
echo "(q) - quit"
|
|
|
|
echo ""
|
2015-11-19 16:14:40 +01:00
|
|
|
echo -n "(Default: stable) Choose an option; " ; read VER
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
if [ "$VER" == "1" -o "$VER" == "ESR" ] ; then
|
2015-11-19 16:14:40 +01:00
|
|
|
RELEASE="firefox-esr-latest"
|
2015-03-21 20:04:17 +01:00
|
|
|
step2_choose_language
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
elif [ "$VER" == "2" -o "$VER" == "stable" ] ; then
|
2015-11-19 16:14:40 +01:00
|
|
|
RELEASE="firefox-latest"
|
2015-03-21 20:04:17 +01:00
|
|
|
step2_choose_language
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
elif [ "$VER" == "3" -o "$VER" == "beta" ] ; then
|
2015-11-19 16:14:40 +01:00
|
|
|
RELEASE="firefox-beta-latest"
|
2015-03-21 20:04:17 +01:00
|
|
|
step2_choose_language
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
elif [ "${VER:-NO_VALUE}" == "NO_VALUE" ] ; then
|
2015-11-19 16:14:40 +01:00
|
|
|
RELEASE="firefox-latest"
|
2015-03-21 20:04:17 +01:00
|
|
|
step2_choose_language
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
elif [ "$VER" == "q" -o "$VER" == "quit" ] ; then
|
|
|
|
exit
|
2015-10-14 18:15:33 +02:00
|
|
|
|
2015-03-21 20:04:17 +01:00
|
|
|
else
|
2015-10-14 18:15:33 +02:00
|
|
|
clear
|
|
|
|
echo ""
|
|
|
|
echo "Invalid option, please, choose any available version"
|
|
|
|
echo ""
|
|
|
|
echo -n "Press 'ENTER' to return "
|
2015-03-21 20:04:17 +01:00
|
|
|
read notversion
|
|
|
|
step1_choose_version
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# Initialize the first step of the installation.
|
2015-11-19 16:14:40 +01:00
|
|
|
check_other_installs_on_system
|