Fixed to work with new URL (https://download.mozilla.org/)

This commit is contained in:
clamsawd 2015-11-19 16:14:40 +01:00
parent 7bd5828f7c
commit 477aa9fd65
2 changed files with 130 additions and 238 deletions

View File

@ -2,10 +2,10 @@
# Script to install Firefox on GNU/Linux # Script to install Firefox on GNU/Linux
# Created by clamsawd (clamsawd@openmailbox.org) # Created by clamsawd (clamsawd@openmailbox.org)
# Version 2.2
# Licensed by GPL v.2 # Licensed by GPL v.2
# Last update: 26-10-2015 # Last update: 19-11-2015
# -------------------------------------- # --------------------------------------
VERSION="3.0"
# Check if 'user' is 'root' # Check if 'user' is 'root'
user=$(whoami) user=$(whoami)
@ -19,7 +19,7 @@ user=$(whoami)
# Detect "kernel" name # Detect "kernel" name
KERNEL=$(uname -s) KERNEL=$(uname -s)
if [ $KERNEL == "Linux" ]; then if [ $KERNEL == "Linux" ]; then
KERNEL=linux KERNEL="linux"
else else
echo "Unsupported OS ($KERNEL)" echo "Unsupported OS ($KERNEL)"
exit 0 exit 0
@ -54,17 +54,13 @@ KERNEL=$(uname -s)
echo "" echo ""
echo " <-Downloading Mozilla Firefox->" echo " <-Downloading Mozilla Firefox->"
cd /tmp/ cd /tmp/
if [ "$APP_DOWNLOAD" == "curl" ] ; then
$APP_DOWNLOAD $SERVER > firefox-$VERSION
else
$APP_DOWNLOAD $SERVER $APP_DOWNLOAD $SERVER
fi
echo " <-Installing Mozilla Firefox->" echo " <-Installing Mozilla Firefox->"
tar jxvf firefox-$VERSION -C /opt/ tar jxvf $RELEASE.tar.bz2 -C /opt/
rm -rf /usr/bin/firefox rm -rf /usr/bin/firefox
ln -s /opt/firefox/firefox /usr/bin/firefox ln -s /opt/firefox/firefox /usr/bin/firefox
chmod 755 -R /opt/firefox/ chmod 755 -R /opt/firefox/
rm -rf /tmp/firefox-$VERSION rm -rf /tmp/$RELEASE.tar.bz2
create_firefox_icon create_firefox_icon
} }
@ -73,26 +69,29 @@ KERNEL=$(uname -s)
# the install ('install_firefox' function). # the install ('install_firefox' function).
function step5_install_firefox(){ function step5_install_firefox(){
SERVER=http://archive.mozilla.org/pub/firefox/releases/$RELEASE/$ARCH/$LANGUAGE/firefox-$VERSION SERVER="https://download.mozilla.org/?product=$RELEASE&os=$ARCH&lang=$LANGUAGE"
clear clear
echo "" echo ""
echo "firefox-install v$VERSION"
echo "--------------------"
echo ""
echo "[Step 5/5] Check your selected installation:" echo "[Step 5/5] Check your selected installation:"
echo "" echo ""
echo "Install: Mozilla Firefox" echo "Install: Mozilla Firefox"
echo "Package: firefox-$VERSION" echo "Package: $RELEASE"
echo "Language: $LANGUAGE" echo "Language: $LANGUAGE"
echo "Arch: $ARCH" echo "Arch: $ARCH_NAME"
echo "Directory: /opt/firefox/" echo "Directory: /opt/firefox/"
echo "" echo ""
echo "Apps: $NAME_APP (download), tar (unpack) " echo "Apps: $NAME_APP (download), tar (unpack) "
echo "" echo ""
echo -n "(default: y) Is correct (y/n/q); " ; read VAREND echo -n "(default: y) Is correct? (y/n/q); " ; read VAREND
if [ "${VAREND:-NO_VALUE}" == "NO_VALUE" -o "$VAREND" == "yes" -o "$VAREND" == "y" ] ; then if [ "${VAREND:-NO_VALUE}" == "NO_VALUE" -o "$VAREND" == "yes" -o "$VAREND" == "y" ] ; then
install_firefox install_firefox
elif [ "$VAREND" == "no" -o "$VAREND" == "n" ] ; then elif [ "$VAREND" == "no" -o "$VAREND" == "n" ] ; then
get_list_versions step1_choose_version
elif [ "$VAREND" == "q" -o "$VAREND" == "quit" ] ; then elif [ "$VAREND" == "q" -o "$VAREND" == "quit" ] ; then
exit exit
@ -115,23 +114,23 @@ KERNEL=$(uname -s)
wget --help > /dev/null wget --help > /dev/null
if [ "$?" -eq 0 ] ; then if [ "$?" -eq 0 ] ; then
WGET=Available WGET="Available"
else else
WGET='Not available' WGET="Not available"
fi fi
aria2c --help > /dev/null aria2c --help > /dev/null
if [ "$?" -eq 0 ] ; then if [ "$?" -eq 0 ] ; then
ARIA2C=Available ARIA2C="Available"
else else
ARIA2C='Not available' ARIA2C="Not available"
fi fi
axel --help > /dev/null axel --help > /dev/null
if [ "$?" -eq 0 ] ; then if [ "$?" -eq 0 ] ; then
AXEL=Available AXEL="Available"
else else
AXEL='Not available' AXEL="Not available"
fi fi
step4_choose_app_download step4_choose_app_download
} }
@ -154,10 +153,10 @@ function check_other_installs_on_system(){
echo -n "(Default: overwrite) Choose an option; " ; read INST echo -n "(Default: overwrite) Choose an option; " ; read INST
if [ "${INST:-NO_VALUE}" == "NO_VALUE" ] ; then if [ "${INST:-NO_VALUE}" == "NO_VALUE" ] ; then
get_list_versions step1_choose_version
elif [ "$INST" == "1" -o "$INST" == "overwrite" ] ; then elif [ "$INST" == "1" -o "$INST" == "overwrite" ] ; then
get_list_versions step1_choose_version
elif [ "$INST" == "2" -o "$INST" == "uninstall" ] ; then elif [ "$INST" == "2" -o "$INST" == "uninstall" ] ; then
@ -186,24 +185,7 @@ function check_other_installs_on_system(){
check_other_installs_on_system check_other_installs_on_system
fi fi
else else
get_list_versions step1_choose_version
fi
}
# Check if 'git' is installed and cancel the installation
# if it is not installed. Initialize the 'check_other_installs_on_system'
# too.
function check_curl_on_system(){
curl --help > /dev/null
if [ "$?" -eq 0 ] ; then
check_other_installs_on_system
else
clear
echo ""
echo "Error: Need 'curl' installed on your system!"
echo ""
exit
fi fi
} }
@ -214,6 +196,9 @@ function check_other_installs_on_system(){
clear clear
echo "" echo ""
echo "firefox-install v$VERSION"
echo "--------------------"
echo ""
echo "[ Step 4/5 (App to download) ]" echo "[ Step 4/5 (App to download) ]"
echo "" echo ""
echo "Available apps to download:" echo "Available apps to download:"
@ -221,20 +206,19 @@ function check_other_installs_on_system(){
echo "(1) - wget ($WGET)" echo "(1) - wget ($WGET)"
echo "(2) - aria2c ($ARIA2C)" echo "(2) - aria2c ($ARIA2C)"
echo "(3) - axel ($AXEL)" echo "(3) - axel ($AXEL)"
echo "(4) - curl (Available)"
echo "" echo ""
echo "(q) - quit" echo "(q) - quit"
echo "" echo ""
APP=0 APP=0
echo -n "(Default: curl) Choose an option; " ; read APP echo -n "(Default: wget) Choose an option; " ; read APP
if [ "$APP" == "1" -o "$APP" == "wget" ] ; then if [ "$APP" == "1" -o "$APP" == "wget" -o "${APP:-NO_VALUE}" == "NO_VALUE" ] ; then
# Check if 'wget' is available using the variable # Check if 'wget' is available using the variable
# defined in 'check_downloaders_on_system' function. # defined in 'check_downloaders_on_system' function.
if [ "$WGET" == "Available" ]; then if [ "$WGET" == "Available" ]; then
APP_DOWNLOAD='wget -c' APP_DOWNLOAD="wget -O $RELEASE.tar.bz2 -c"
NAME_APP='wget' NAME_APP="wget"
step5_install_firefox step5_install_firefox
else else
clear clear
@ -251,8 +235,8 @@ function check_other_installs_on_system(){
# Check if 'aria2c' is available using the variable # Check if 'aria2c' is available using the variable
# defined in 'check_downloaders_on_system' function. # defined in 'check_downloaders_on_system' function.
if [ "$ARIA2C" == "Available" ]; then if [ "$ARIA2C" == "Available" ]; then
APP_DOWNLOAD='aria2c --check-certificate=false' APP_DOWNLOAD="aria2c --check-certificate=false -o $RELEASE.tar.bz2"
NAME_APP='aria2c' NAME_APP="aria2c"
step5_install_firefox step5_install_firefox
else else
clear clear
@ -269,8 +253,8 @@ function check_other_installs_on_system(){
# Check if 'axel' is available using the variable # Check if 'axel' is available using the variable
# defined in 'check_downloaders_on_system' function. # defined in 'check_downloaders_on_system' function.
if [ "$AXEL" == "Available" ]; then if [ "$AXEL" == "Available" ]; then
APP_DOWNLOAD='axel' APP_DOWNLOAD="axel -o $RELEASE.tar.bz2"
NAME_APP='axel' NAME_APP="axel"
step5_install_firefox step5_install_firefox
else else
clear clear
@ -282,20 +266,8 @@ function check_other_installs_on_system(){
step4_choose_app_download step4_choose_app_download
fi fi
elif [ "$APP" == "4" -o "$APP" == "curl" ] ; then
APP_DOWNLOAD='curl'
NAME_APP='curl'
step5_install_firefox
elif [ "$APP" == "q" -o "$APP" == "quit" ] ; then elif [ "$APP" == "q" -o "$APP" == "quit" ] ; then
exit exit
elif [ "${APP:-NO_VALUE}" == "NO_VALUE" ] ; then
APP_DOWNLOAD='curl'
NAME_APP='curl'
step5_install_firefox
else else
clear clear
echo "" echo ""
@ -313,12 +285,15 @@ function check_other_installs_on_system(){
clear clear
echo "" echo ""
echo "firefox-install v$VERSION"
echo "--------------------"
echo ""
echo "[ Step 3/5 (Arch) ]" echo "[ Step 3/5 (Arch) ]"
echo "" echo ""
echo "Available Arch:" echo "Available Arch:"
echo "" echo ""
echo "(1) - 32 bits (linux-i686)" echo "(1) - 32 bits (linux)"
echo "(2) - 64 bits (linux-x86_64)" echo "(2) - 64 bits (linux64)"
echo "" echo ""
echo "(q) - quit" echo "(q) - quit"
echo "" echo ""
@ -331,11 +306,13 @@ function check_other_installs_on_system(){
archs=`uname -m` archs=`uname -m`
case "$archs" in case "$archs" in
i?86) i?86)
ARCH=linux-i686 ARCH="linux"
ARCH_NAME="x86"
check_downloaders_on_system check_downloaders_on_system
;; ;;
x86_64) x86_64)
ARCH=linux-x86_64 ARCH="linux64"
ARCH_NAME="x86_64"
check_downloaders_on_system check_downloaders_on_system
;; ;;
*) *)
@ -344,11 +321,13 @@ function check_other_installs_on_system(){
esac esac
elif [ "$AR" == "1" -o "$AR" == "32" ] ; then elif [ "$AR" == "1" -o "$AR" == "32" ] ; then
ARCH=linux-i686 ARCH="linux"
ARCH_NAME="x86"
check_downloaders_on_system check_downloaders_on_system
elif [ "$AR" == "2" -o "$AR" == "64" ] ; then elif [ "$AR" == "2" -o "$AR" == "64" ] ; then
ARCH=linux-x86_64 ARCH="linux64"
ARCH_NAME="x86_64"
check_downloaders_on_system check_downloaders_on_system
elif [ "$AR" == "q" -o "$AR" == "quit" ] ; then elif [ "$AR" == "q" -o "$AR" == "quit" ] ; then
@ -372,6 +351,9 @@ function check_other_installs_on_system(){
FILE_LANGUAGES=/tmp/firefox-languages FILE_LANGUAGES=/tmp/firefox-languages
clear clear
echo "" echo ""
echo "firefox-install v$VERSION"
echo "--------------------"
echo ""
echo "[ Step 2/5 (Language) ]" echo "[ Step 2/5 (Language) ]"
echo "" echo ""
echo "Available languages:" echo "Available languages:"
@ -405,7 +387,7 @@ function check_other_installs_on_system(){
if [ "$LANGUAGE_VAR" == "$LANG" ]; then if [ "$LANGUAGE_VAR" == "$LANG" ]; then
LANGUAGE=$LANG LANGUAGE="$LANG"
step3_choose_arch step3_choose_arch
else else
@ -428,75 +410,39 @@ function check_other_installs_on_system(){
fi fi
} }
# Get the list of available firefox versions using 'curl',
# and initialize the 'step2_choose_language' function.
function get_list_versions() {
clear
echo ""
echo "Getting information of available versions, please wait.."
echo ""
TMP_FILE_STABLE=/tmp/moz_versions_st
TMP_FILE_BETA=/tmp/moz_versions_bt
TMP_FILE_ESR=/tmp/moz_versions_esr
HTTP_FIREFOX=http://archive.mozilla.org/pub/firefox/releases
curl "$HTTP_FIREFOX/latest/linux-x86_64/en-US/" | grep "tar.bz2" | cut -d "-" -f 4 | cut -d "<" -f 1 | cut -d '"' -f 1 | tail -n 1 > $TMP_FILE_STABLE
curl "$HTTP_FIREFOX/latest-beta/linux-x86_64/en-US/" | grep "tar.bz2" | cut -d "-" -f 5 | cut -d "<" -f 1 | cut -d '"' -f 1 | tail -n 1 > $TMP_FILE_BETA
curl "$HTTP_FIREFOX/latest-esr/linux-x86_64/en-US/" | grep "tar.bz2" | cut -d "-" -f 5 | cut -d "<" -f 1 | cut -d '"' -f 1 | tail -n 1 > $TMP_FILE_ESR
error=$?
if [ $? -eq 0 ] ; then
echo "OK" > /dev/null
step1_choose_version
else
clear
echo ""
echo "Error: Failed to obtain the required information from the server!"
echo "Connection Fail!"
echo ""
exit
fi
}
function step1_choose_version(){ function step1_choose_version(){
FIREFOX_STABLE=`cat $TMP_FILE_STABLE`
FIREFOX_BETA=`cat $TMP_FILE_BETA`
FIREFOX_ESR=`cat $TMP_FILE_ESR`
DEFAULT=`cat $TMP_FILE_STABLE`
clear clear
echo "" echo ""
echo "firefox-install v$VERSION"
echo "--------------------"
echo ""
echo "[ Step 1/5 (Version) ]" echo "[ Step 1/5 (Version) ]"
echo "" echo ""
echo "Available Versions:" echo "Available Versions:"
echo "" echo ""
echo "(1) - firefox-$FIREFOX_ESR (ESR)" echo "(1) - firefox-esr-latest (ESR)"
echo "(2) - firefox-$FIREFOX_STABLE (stable)" echo "(2) - firefox-latest (stable)"
echo "(3) - firefox-$FIREFOX_BETA (beta)" echo "(3) - firefox-beta-latest (beta)"
echo "" echo ""
echo "(q) - quit" echo "(q) - quit"
echo "" echo ""
echo -n "(Default: firefox-$DEFAULT) Choose an option; " ; read VER echo -n "(Default: stable) Choose an option; " ; read VER
if [ "$VER" == "1" -o "$VER" == "ESR" ] ; then if [ "$VER" == "1" -o "$VER" == "ESR" ] ; then
VERSION=$FIREFOX_ESR RELEASE="firefox-esr-latest"
RELEASE="latest-esr"
step2_choose_language step2_choose_language
elif [ "$VER" == "2" -o "$VER" == "stable" ] ; then elif [ "$VER" == "2" -o "$VER" == "stable" ] ; then
VERSION=$FIREFOX_STABLE RELEASE="firefox-latest"
RELEASE="latest"
step2_choose_language step2_choose_language
elif [ "$VER" == "3" -o "$VER" == "beta" ] ; then elif [ "$VER" == "3" -o "$VER" == "beta" ] ; then
VERSION=$FIREFOX_BETA RELEASE="firefox-beta-latest"
RELEASE="latest-beta"
step2_choose_language step2_choose_language
elif [ "${VER:-NO_VALUE}" == "NO_VALUE" ] ; then elif [ "${VER:-NO_VALUE}" == "NO_VALUE" ] ; then
VERSION=$DEFAULT RELEASE="firefox-latest"
RELEASE="latest"
step2_choose_language step2_choose_language
elif [ "$VER" == "q" -o "$VER" == "quit" ] ; then elif [ "$VER" == "q" -o "$VER" == "quit" ] ; then
@ -514,4 +460,4 @@ function check_other_installs_on_system(){
} }
# Initialize the first step of the installation. # Initialize the first step of the installation.
check_curl_on_system check_other_installs_on_system

View File

@ -2,10 +2,10 @@
# Script to install Thunderbird on GNU/Linux # Script to install Thunderbird on GNU/Linux
# Created by clamsawd (clamsawd@openmailbox.org) # Created by clamsawd (clamsawd@openmailbox.org)
# Version 2.2
# Licensed by GPL v.2 # Licensed by GPL v.2
# Last update: 26-10-2015 # Last update: 19-11-2015
# -------------------------------------- # --------------------------------------
VERSION="3.0"
# Check if 'user' is 'root' # Check if 'user' is 'root'
user=$(whoami) user=$(whoami)
@ -19,13 +19,13 @@ user=$(whoami)
# Detect "kernel" name # Detect "kernel" name
KERNEL=$(uname -s) KERNEL=$(uname -s)
if [ $KERNEL == "Linux" ]; then if [ $KERNEL == "Linux" ]; then
KERNEL=linux KERNEL="linux"
else else
echo "Unsupported OS ($KERNEL)" echo "Unsupported OS ($KERNEL)"
exit 0 exit 0
fi fi
# Create Mozilla thunderbird shortcut after of install it. # Create Mozilla Thunderbird shortcut after of install it.
function create_thunderbird_icon(){ function create_thunderbird_icon(){
echo "[Desktop Entry]" > /usr/share/applications/thunderbird.desktop echo "[Desktop Entry]" > /usr/share/applications/thunderbird.desktop
@ -48,23 +48,19 @@ KERNEL=$(uname -s)
} }
# Install thunderbird using 'tar' command and # Install thunderbird using 'tar' command and
# initialize the 'create_THUNDERBIRD_icon' function. # initialize the 'create_thunderbird_icon' function.
function install_thunderbird(){ function install_thunderbird(){
echo "" echo ""
echo " <-Downloading Mozilla Thunderbird->" echo " <-Downloading Mozilla Thunderbird->"
cd /tmp/ cd /tmp/
if [ "$APP_DOWNLOAD" == "curl" ] ; then
$APP_DOWNLOAD $SERVER > thunderbird-$VERSION
else
$APP_DOWNLOAD $SERVER $APP_DOWNLOAD $SERVER
fi
echo " <-Installing Mozilla Thunderbird->" echo " <-Installing Mozilla Thunderbird->"
tar jxvf thunderbird-$VERSION -C /opt/ tar jxvf $RELEASE.tar.bz2 -C /opt/
rm -rf /usr/bin/thunderbird rm -rf /usr/bin/thunderbird
ln -s /opt/thunderbird/thunderbird /usr/bin/thunderbird ln -s /opt/thunderbird/thunderbird /usr/bin/thunderbird
chmod 755 -R /opt/thunderbird/ chmod 755 -R /opt/thunderbird/
rm -rf /tmp/thunderbird-$VERSION rm -rf /tmp/$RELEASE.tar.bz2
create_thunderbird_icon create_thunderbird_icon
} }
@ -73,26 +69,29 @@ KERNEL=$(uname -s)
# the install ('install_thunderbird' function). # the install ('install_thunderbird' function).
function step5_install_thunderbird(){ function step5_install_thunderbird(){
SERVER=http://archive.mozilla.org/pub/thunderbird/releases/$RELEASE/$ARCH/$LANGUAGE/thunderbird-$VERSION SERVER="https://download.mozilla.org/?product=$RELEASE&os=$ARCH&lang=$LANGUAGE"
clear clear
echo "" echo ""
echo "thunderbird-install v$VERSION"
echo "------------------------"
echo ""
echo "[Step 5/5] Check your selected installation:" echo "[Step 5/5] Check your selected installation:"
echo "" echo ""
echo "Install: Mozilla Thunderbird" echo "Install: Mozilla Thunderbird"
echo "Package: thunderbird-$VERSION" echo "Package: $RELEASE"
echo "Language: $LANGUAGE" echo "Language: $LANGUAGE"
echo "Arch: $ARCH" echo "Arch: $ARCH_NAME"
echo "Directory: /opt/thunderbird/" echo "Directory: /opt/thunderbird/"
echo "" echo ""
echo "Apps: $NAME_APP (download), tar (unpack) " echo "Apps: $NAME_APP (download), tar (unpack) "
echo "" echo ""
echo -n "(default: y) Is correct (y/n/q); " ; read VAREND echo -n "(default: y) Is correct? (y/n/q); " ; read VAREND
if [ "${VAREND:-NO_VALUE}" == "NO_VALUE" -o "$VAREND" == "yes" -o "$VAREND" == "y" ] ; then if [ "${VAREND:-NO_VALUE}" == "NO_VALUE" -o "$VAREND" == "yes" -o "$VAREND" == "y" ] ; then
install_thunderbird install_thunderbird
elif [ "$VAREND" == "no" -o "$VAREND" == "n" ] ; then elif [ "$VAREND" == "no" -o "$VAREND" == "n" ] ; then
get_list_versions step1_choose_version
elif [ "$VAREND" == "q" -o "$VAREND" == "quit" ] ; then elif [ "$VAREND" == "q" -o "$VAREND" == "quit" ] ; then
exit exit
@ -115,23 +114,23 @@ KERNEL=$(uname -s)
wget --help > /dev/null wget --help > /dev/null
if [ "$?" -eq 0 ] ; then if [ "$?" -eq 0 ] ; then
WGET=Available WGET="Available"
else else
WGET='Not available' WGET="Not available"
fi fi
aria2c --help > /dev/null aria2c --help > /dev/null
if [ "$?" -eq 0 ] ; then if [ "$?" -eq 0 ] ; then
ARIA2C=Available ARIA2C="Available"
else else
ARIA2C='Not available' ARIA2C="Not available"
fi fi
axel --help > /dev/null axel --help > /dev/null
if [ "$?" -eq 0 ] ; then if [ "$?" -eq 0 ] ; then
AXEL=Available AXEL="Available"
else else
AXEL='Not available' AXEL="Not available"
fi fi
step4_choose_app_download step4_choose_app_download
} }
@ -154,10 +153,10 @@ function check_other_installs_on_system(){
echo -n "(Default: overwrite) Choose an option; " ; read INST echo -n "(Default: overwrite) Choose an option; " ; read INST
if [ "${INST:-NO_VALUE}" == "NO_VALUE" ] ; then if [ "${INST:-NO_VALUE}" == "NO_VALUE" ] ; then
get_list_versions step1_choose_version
elif [ "$INST" == "1" -o "$INST" == "overwrite" ] ; then elif [ "$INST" == "1" -o "$INST" == "overwrite" ] ; then
get_list_versions step1_choose_version
elif [ "$INST" == "2" -o "$INST" == "uninstall" ] ; then elif [ "$INST" == "2" -o "$INST" == "uninstall" ] ; then
@ -186,24 +185,7 @@ function check_other_installs_on_system(){
check_other_installs_on_system check_other_installs_on_system
fi fi
else else
get_list_versions step1_choose_version
fi
}
# Check if 'git' is installed and cancel the installation
# if it is not installed. Initialize the 'check_other_installs_on_system'
# too.
function check_curl_on_system(){
curl --help > /dev/null
if [ "$?" -eq 0 ] ; then
check_other_installs_on_system
else
clear
echo ""
echo "Error: Need 'curl' installed on your system!"
echo ""
exit
fi fi
} }
@ -214,6 +196,9 @@ function check_other_installs_on_system(){
clear clear
echo "" echo ""
echo "thunderbird-install v$VERSION"
echo "------------------------"
echo ""
echo "[ Step 4/5 (App to download) ]" echo "[ Step 4/5 (App to download) ]"
echo "" echo ""
echo "Available apps to download:" echo "Available apps to download:"
@ -221,20 +206,19 @@ function check_other_installs_on_system(){
echo "(1) - wget ($WGET)" echo "(1) - wget ($WGET)"
echo "(2) - aria2c ($ARIA2C)" echo "(2) - aria2c ($ARIA2C)"
echo "(3) - axel ($AXEL)" echo "(3) - axel ($AXEL)"
echo "(4) - curl (Available)"
echo "" echo ""
echo "(q) - quit" echo "(q) - quit"
echo "" echo ""
APP=0 APP=0
echo -n "(Default: curl) Choose an option; " ; read APP echo -n "(Default: wget) Choose an option; " ; read APP
if [ "$APP" == "1" -o "$APP" == "wget" ] ; then if [ "$APP" == "1" -o "$APP" == "wget" -o "${APP:-NO_VALUE}" == "NO_VALUE" ] ; then
# Check if 'wget' is available using the variable # Check if 'wget' is available using the variable
# defined in 'check_downloaders_on_system' function. # defined in 'check_downloaders_on_system' function.
if [ "$WGET" == "Available" ]; then if [ "$WGET" == "Available" ]; then
APP_DOWNLOAD='wget -c' APP_DOWNLOAD="wget -O $RELEASE.tar.bz2 -c"
NAME_APP='wget' NAME_APP="wget"
step5_install_thunderbird step5_install_thunderbird
else else
clear clear
@ -251,8 +235,8 @@ function check_other_installs_on_system(){
# Check if 'aria2c' is available using the variable # Check if 'aria2c' is available using the variable
# defined in 'check_downloaders_on_system' function. # defined in 'check_downloaders_on_system' function.
if [ "$ARIA2C" == "Available" ]; then if [ "$ARIA2C" == "Available" ]; then
APP_DOWNLOAD='aria2c --check-certificate=false' APP_DOWNLOAD="aria2c --check-certificate=false -o $RELEASE.tar.bz2"
NAME_APP='aria2c' NAME_APP="aria2c"
step5_install_thunderbird step5_install_thunderbird
else else
clear clear
@ -269,8 +253,8 @@ function check_other_installs_on_system(){
# Check if 'axel' is available using the variable # Check if 'axel' is available using the variable
# defined in 'check_downloaders_on_system' function. # defined in 'check_downloaders_on_system' function.
if [ "$AXEL" == "Available" ]; then if [ "$AXEL" == "Available" ]; then
APP_DOWNLOAD='axel' APP_DOWNLOAD="axel -o $RELEASE.tar.bz2"
NAME_APP='axel' NAME_APP="axel"
step5_install_thunderbird step5_install_thunderbird
else else
clear clear
@ -282,20 +266,8 @@ function check_other_installs_on_system(){
step4_choose_app_download step4_choose_app_download
fi fi
elif [ "$APP" == "4" -o "$APP" == "curl" ] ; then
APP_DOWNLOAD='curl'
NAME_APP='curl'
step5_install_thunderbird
elif [ "$APP" == "q" -o "$APP" == "quit" ] ; then elif [ "$APP" == "q" -o "$APP" == "quit" ] ; then
exit exit
elif [ "${APP:-NO_VALUE}" == "NO_VALUE" ] ; then
APP_DOWNLOAD='curl'
NAME_APP='curl'
step5_install_thunderbird
else else
clear clear
echo "" echo ""
@ -313,12 +285,15 @@ function check_other_installs_on_system(){
clear clear
echo "" echo ""
echo "thunderbird-install v$VERSION"
echo "------------------------"
echo ""
echo "[ Step 3/5 (Arch) ]" echo "[ Step 3/5 (Arch) ]"
echo "" echo ""
echo "Available Arch:" echo "Available Arch:"
echo "" echo ""
echo "(1) - 32 bits (linux-i686)" echo "(1) - 32 bits (linux)"
echo "(2) - 64 bits (linux-x86_64)" echo "(2) - 64 bits (linux64)"
echo "" echo ""
echo "(q) - quit" echo "(q) - quit"
echo "" echo ""
@ -331,11 +306,13 @@ function check_other_installs_on_system(){
archs=`uname -m` archs=`uname -m`
case "$archs" in case "$archs" in
i?86) i?86)
ARCH=linux-i686 ARCH="linux"
ARCH_NAME="x86"
check_downloaders_on_system check_downloaders_on_system
;; ;;
x86_64) x86_64)
ARCH=linux-x86_64 ARCH="linux64"
ARCH_NAME="x86_64"
check_downloaders_on_system check_downloaders_on_system
;; ;;
*) *)
@ -344,11 +321,13 @@ function check_other_installs_on_system(){
esac esac
elif [ "$AR" == "1" -o "$AR" == "32" ] ; then elif [ "$AR" == "1" -o "$AR" == "32" ] ; then
ARCH=linux-i686 ARCH="linux"
ARCH_NAME="x86"
check_downloaders_on_system check_downloaders_on_system
elif [ "$AR" == "2" -o "$AR" == "64" ] ; then elif [ "$AR" == "2" -o "$AR" == "64" ] ; then
ARCH=linux-x86_64 ARCH="linux64"
ARCH_NAME="x86_64"
check_downloaders_on_system check_downloaders_on_system
elif [ "$AR" == "q" -o "$AR" == "quit" ] ; then elif [ "$AR" == "q" -o "$AR" == "quit" ] ; then
@ -372,6 +351,9 @@ function check_other_installs_on_system(){
FILE_LANGUAGES=/tmp/thunderbird-languages FILE_LANGUAGES=/tmp/thunderbird-languages
clear clear
echo "" echo ""
echo "thunderbird-install v$VERSION"
echo "------------------------"
echo ""
echo "[ Step 2/5 (Language) ]" echo "[ Step 2/5 (Language) ]"
echo "" echo ""
echo "Available languages:" echo "Available languages:"
@ -405,7 +387,7 @@ function check_other_installs_on_system(){
if [ "$LANGUAGE_VAR" == "$LANG" ]; then if [ "$LANGUAGE_VAR" == "$LANG" ]; then
LANGUAGE=$LANG LANGUAGE="$LANG"
step3_choose_arch step3_choose_arch
else else
@ -428,75 +410,39 @@ function check_other_installs_on_system(){
fi fi
} }
# Get the list of available thunderbird versions using 'curl',
# and initialize the 'step2_choose_language' function.
function get_list_versions() {
clear
echo ""
echo "Getting information of available versions, please wait.."
echo ""
TMP_FILE_STABLE=/tmp/moz_versions_st
TMP_FILE_BETA=/tmp/moz_versions_bt
TMP_FILE_ESR=/tmp/moz_versions_esr
HTTP_THUNDERBIRD=http://archive.mozilla.org/pub/thunderbird/releases
curl "$HTTP_THUNDERBIRD/latest/linux-x86_64/en-US/" | grep "tar.bz2" | cut -d "-" -f 4 | cut -d "<" -f 1 | cut -d '"' -f 1 | tail -n 1 > $TMP_FILE_STABLE
curl "$HTTP_THUNDERBIRD/latest-beta/linux-x86_64/en-US/" | grep "tar.bz2" | cut -d "-" -f 5 | cut -d "<" -f 1 | cut -d '"' -f 1 | tail -n 1 > $TMP_FILE_BETA
curl "$HTTP_THUNDERBIRD/latest-esr/linux-x86_64/en-US/" | grep "tar.bz2" | cut -d "-" -f 5 | cut -d "<" -f 1 | cut -d '"' -f 1 | tail -n 1 > $TMP_FILE_ESR
error=$?
if [ $? -eq 0 ] ; then
echo "OK" > /dev/null
step1_choose_version
else
clear
echo ""
echo "Error: Failed to obtain the required information from the server!"
echo "Connection Fail!"
echo ""
exit
fi
}
function step1_choose_version(){ function step1_choose_version(){
THUNDERBIRD_STABLE=`cat $TMP_FILE_STABLE`
THUNDERBIRD_BETA=`cat $TMP_FILE_BETA`
THUNDERBIRD_ESR=`cat $TMP_FILE_ESR`
DEFAULT=`cat $TMP_FILE_STABLE`
clear clear
echo "" echo ""
echo "thunderbird-install v$VERSION"
echo "------------------------"
echo ""
echo "[ Step 1/5 (Version) ]" echo "[ Step 1/5 (Version) ]"
echo "" echo ""
echo "Available Versions:" echo "Available Versions:"
echo "" echo ""
echo "(1) - thunderbird-$THUNDERBIRD_ESR (ESR)" echo "(1) - thunderbird-esr-latest (ESR)"
echo "(2) - thunderbird-$THUNDERBIRD_STABLE (stable)" echo "(2) - thunderbird-latest (stable)"
echo "(3) - thunderbird-$THUNDERBIRD_BETA (beta)" echo "(3) - thunderbird-beta-latest (beta)"
echo "" echo ""
echo "(q) - quit" echo "(q) - quit"
echo "" echo ""
echo -n "(Default: thunderbird-$DEFAULT) Choose an option; " ; read VER echo -n "(Default: stable) Choose an option; " ; read VER
if [ "$VER" == "1" -o "$VER" == "ESR" ] ; then if [ "$VER" == "1" -o "$VER" == "ESR" ] ; then
VERSION=$THUNDERBIRD_ESR RELEASE="thunderbird-esr-latest"
RELEASE="latest-esr"
step2_choose_language step2_choose_language
elif [ "$VER" == "2" -o "$VER" == "stable" ] ; then elif [ "$VER" == "2" -o "$VER" == "stable" ] ; then
VERSION=$THUNDERBIRD_STABLE RELEASE="thunderbird-latest"
RELEASE="latest"
step2_choose_language step2_choose_language
elif [ "$VER" == "3" -o "$VER" == "beta" ] ; then elif [ "$VER" == "3" -o "$VER" == "beta" ] ; then
VERSION=$THUNDERBIRD_BETA RELEASE="thunderbird-beta-latest"
RELEASE="latest-beta"
step2_choose_language step2_choose_language
elif [ "${VER:-NO_VALUE}" == "NO_VALUE" ] ; then elif [ "${VER:-NO_VALUE}" == "NO_VALUE" ] ; then
VERSION=$DEFAULT RELEASE="thunderbird-latest"
RELEASE="latest"
step2_choose_language step2_choose_language
elif [ "$VER" == "q" -o "$VER" == "quit" ] ; then elif [ "$VER" == "q" -o "$VER" == "quit" ] ; then
@ -514,4 +460,4 @@ function check_other_installs_on_system(){
} }
# Initialize the first step of the installation. # Initialize the first step of the installation.
check_curl_on_system check_other_installs_on_system