Defined 'curl' by default

This commit is contained in:
clamsawd 2015-10-14 18:15:33 +02:00
parent 64d8b6a62e
commit b787264192
2 changed files with 450 additions and 486 deletions

View File

@ -2,19 +2,11 @@
# Script to install Firefox on GNU/Linux
# Created by clamsawd (clamsawd@openmailbox.org)
# Version 2.0
# Version 2.1
# Licensed by GPL v.2
# Last update: 24-08-2015
# Last update: 14-10-2015
# --------------------------------------
function printf(){
echo "$1" "$2"
}
function textprint(){
echo "$1"
}
# Check if 'user' is 'root'
user=$(whoami)
if [ "$user" == "root" ] ; then
@ -36,22 +28,22 @@ KERNEL=$(uname -s)
# Create Mozilla Firefox shortcut after of install it.
function create_firefox_icon(){
textprint "[Desktop Entry]" > /usr/share/applications/firefox.desktop
#textprint "Encoding=UTF-8" >> /usr/share/applications/firefox.desktop
textprint "Name=Mozilla Firefox" >> /usr/share/applications/firefox.desktop
textprint "Comment=Browse the World Wide Web" >> /usr/share/applications/firefox.desktop
textprint "GenericName=Web Browser" >> /usr/share/applications/firefox.desktop
textprint "X-GNOME-FullName=Mozilla Firefox" >> /usr/share/applications/firefox.desktop
textprint "Exec=firefox %u" >> /usr/share/applications/firefox.desktop
textprint "Terminal=false" >> /usr/share/applications/firefox.desktop
textprint "X-MultipleArgs=false" >> /usr/share/applications/firefox.desktop
textprint "Type=Application" >> /usr/share/applications/firefox.desktop
textprint "Icon=/opt/firefox/browser/icons/mozicon128.png" >> /usr/share/applications/firefox.desktop
textprint "Categories=Network;WebBrowser;" >> /usr/share/applications/firefox.desktop
#textprint "StartupWMClass=Firefox-bin" >> /usr/share/applications/firefox.desktop
textprint "StartupNotify=true" >> /usr/share/applications/firefox.desktop
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
echo "Icon=/opt/firefox/browser/icons/mozicon128.png" >> /usr/share/applications/firefox.desktop
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
chmod 755 /usr/share/applications/firefox.desktop
printf " <-Finished->"
echo " <-Finished->"
exit
}
@ -59,15 +51,15 @@ KERNEL=$(uname -s)
# initialize the 'create_firefox_icon' function.
function install_firefox(){
printf ""
printf " <-Downloading Mozilla Firefox->"
echo ""
echo " <-Downloading Mozilla Firefox->"
cd /tmp/
if [ "$APP_DOWNLOAD" == "curl" ] ; then
$APP_DOWNLOAD $SERVER > firefox-$VERSION
else
$APP_DOWNLOAD $SERVER
fi
printf " <-Installing Mozilla Firefox->"
echo " <-Installing Mozilla Firefox->"
tar jxvf firefox-$VERSION -C /opt/
rm -rf /usr/bin/firefox
ln -s /opt/firefox/firefox /usr/bin/firefox
@ -84,18 +76,18 @@ KERNEL=$(uname -s)
SERVER=http://archive.mozilla.org/pub/firefox/releases/$RELEASE/$ARCH/$LANGUAGE/firefox-$VERSION
clear
printf ""
printf "[Step 5/5] Check your selected installation:"
printf ""
printf "Install: Mozilla Firefox"
printf "Package: firefox-$VERSION"
printf "Language: $LANGUAGE"
printf "Arch: $ARCH"
printf "Directory: /opt/firefox/"
printf ""
printf "Apps: $NAME_APP (download) , tar (unpack) "
printf ""
printf -n "(default: y) Is correct (y/n/q); " ; read VAREND
echo ""
echo "[Step 5/5] Check your selected installation:"
echo ""
echo "Install: Mozilla Firefox"
echo "Package: firefox-$VERSION"
echo "Language: $LANGUAGE"
echo "Arch: $ARCH"
echo "Directory: /opt/firefox/"
echo ""
echo "Apps: $NAME_APP (download) , tar (unpack) "
echo ""
echo -n "(default: y) Is correct (y/n/q); " ; read VAREND
if [ "${VAREND:-NO_VALUE}" == "NO_VALUE" -o "$VAREND" == "yes" -o "$VAREND" == "y" ] ; then
install_firefox
@ -107,10 +99,10 @@ KERNEL=$(uname -s)
else
clear
printf ""
printf "Invalid option, please, choose any available option"
printf ""
printf "Press 'ENTER' to return"
echo ""
echo "Invalid option, please, choose any available option"
echo ""
echo -n "Press 'ENTER' to return "
read yesorno
step5_install_firefox
fi
@ -151,15 +143,15 @@ function check_other_installs_on_system(){
if [ -d /opt/firefox/ ]; then
clear
printf ""
printf "Detected a previous installation of Firefox"
printf "Do you want to overwrite or uninstall the current version?"
printf ""
printf "(1) - overwrite"
printf "(2) - uninstall"
printf "(3) - quit (q)"
printf ""
printf -n "(Default: overwrite) Choose an option; " ; read INST
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
if [ "${INST:-NO_VALUE}" == "NO_VALUE" ] ; then
get_list_versions
@ -170,15 +162,15 @@ function check_other_installs_on_system(){
elif [ "$INST" == "2" -o "$INST" == "uninstall" ] ; then
clear
printf ""
printf "Uninstalling Firefox, please wait..."
printf ""
echo ""
echo "Uninstalling Firefox, please wait..."
echo ""
sleep 5
rm -rf /usr/bin/firefox
rm -rf /usr/share/applications/firefox.desktop
rm -rf /opt/firefox/
printf "Done!"
printf ""
echo "Done!"
echo ""
exit
elif [ "$INST" == "3" -o "$INST" == "quit" -o "$INST" == "q" ]; then
@ -186,10 +178,10 @@ function check_other_installs_on_system(){
else
clear
printf ""
printf "Invalid option, please, choose any available option"
printf ""
printf "Press 'ENTER' to return"
echo ""
echo "Invalid option, please, choose any available option"
echo ""
echo -n "Press 'ENTER' to return "
read notoption
check_other_installs_on_system
fi
@ -208,9 +200,9 @@ function check_other_installs_on_system(){
check_other_installs_on_system
else
clear
printf ""
printf "Error: Need 'curl' installed on your system!"
printf ""
echo ""
echo "Error: Need 'curl' installed on your system!"
echo ""
exit
fi
}
@ -221,20 +213,20 @@ function check_other_installs_on_system(){
function step4_choose_app_download(){
clear
printf ""
printf "[ Step 4/5 (App to download) ]"
printf ""
printf "Available apps to download:"
printf ""
printf "(1) - wget ($WGET)"
printf "(2) - aria2c ($ARIA2C)"
printf "(3) - axel ($AXEL)"
printf "(4) - curl (Available)"
printf ""
printf "(q) - quit"
printf ""
echo ""
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 "(4) - curl (Available)"
echo ""
echo "(q) - quit"
echo ""
APP=0
printf -n "(Default: wget) Choose an option; " ; read APP
echo -n "(Default: curl) Choose an option; " ; read APP
if [ "$APP" == "1" -o "$APP" == "wget" ] ; then
@ -246,10 +238,10 @@ function check_other_installs_on_system(){
step5_install_firefox
else
clear
printf ""
printf "'wget' is not available in your system"
printf ""
printf "Press 'ENTER' to return"
echo ""
echo "'wget' is not available in your system"
echo ""
echo -n "Press 'ENTER' to return "
read not
step4_choose_app_download
fi
@ -264,10 +256,10 @@ function check_other_installs_on_system(){
step5_install_firefox
else
clear
printf ""
printf "'aria2c' is not available in your system"
printf ""
printf "Press 'ENTER' to return"
echo ""
echo "'aria2c' is not available in your system"
echo ""
echo -n "Press 'ENTER' to return "
read not
step4_choose_app_download
fi
@ -282,10 +274,10 @@ function check_other_installs_on_system(){
step5_install_firefox
else
clear
printf ""
printf "'axel' is not available in your system"
printf ""
printf "Press 'ENTER' to return"
echo ""
echo "'axel' is not available in your system"
echo ""
echo -n "Press 'ENTER' to return "
read not
step4_choose_app_download
fi
@ -300,26 +292,16 @@ function check_other_installs_on_system(){
exit
elif [ "${APP:-NO_VALUE}" == "NO_VALUE" ] ; then
if [ "$WGET" == "Available" ]; then
APP_DOWNLOAD='wget -c'
NAME_APP='wget'
APP_DOWNLOAD='curl'
NAME_APP='curl'
step5_install_firefox
else
clear
printf ""
printf "'wget' is not available in your system"
printf ""
printf "Press 'ENTER' to return"
read not
step4_choose_app_download
fi
else
clear
printf ""
printf "Invalid option, please, choose any available app"
printf ""
printf "Press 'ENTER' to return"
echo ""
echo "Invalid option, please, choose any available app"
echo ""
echo -n "Press 'ENTER' to return "
read notapp
step4_choose_app_download
fi
@ -330,17 +312,17 @@ function check_other_installs_on_system(){
function step3_choose_arch(){
clear
printf ""
printf "[ Step 3/5 (Arch) ]"
printf ""
printf "Available Arch:"
printf ""
printf "(1) - 32 bits (linux-i686)"
printf "(2) - 64 bits (linux-x86_64)"
printf ""
printf "(q) - quit"
printf ""
printf -n "(Default: autodetect) Choose an option; " ; read AR
echo ""
echo "[ Step 3/5 (Arch) ]"
echo ""
echo "Available Arch:"
echo ""
echo "(1) - 32 bits (linux-i686)"
echo "(2) - 64 bits (linux-x86_64)"
echo ""
echo "(q) - quit"
echo ""
echo -n "(Default: autodetect) Choose an option; " ; read AR
if [ "${AR:-NO_VALUE}" == "NO_VALUE" ] ; then
@ -374,10 +356,10 @@ function check_other_installs_on_system(){
else
clear
printf ""
printf "Invalid option, please, choose any available arch"
printf ""
printf "Press 'ENTER' to return"
echo ""
echo "Invalid option, please, choose any available arch"
echo ""
echo -n "Press 'ENTER' to return "
read notarch
step3_choose_arch
fi
@ -389,28 +371,28 @@ function check_other_installs_on_system(){
FILE_LANGUAGES=/tmp/firefox-languages
clear
printf ""
printf "[ Step 2/5 (Language) ]"
printf ""
printf "Available languages:"
printf ""
printf "[ach] [af] [an] [ar] [as] [ast] [be]" > $FILE_LANGUAGES
printf "[bg] [bn-BD] [bn-IN] [br] [bs] [ca]" >> $FILE_LANGUAGES
printf "[cs] [csb] [cy] [da] [de] [el] [en-GB]" >> $FILE_LANGUAGES
printf "[en-US] [en-ZA] [eo] [es-AR] [es-CL]" >> $FILE_LANGUAGES
printf "[es-ES] [es-MX] [et] [eu] [fa] [ff] [fi]" >> $FILE_LANGUAGES
printf "[fr] [fy-NL] [ga-IE] [gd] [gl] [gu-IN]" >> $FILE_LANGUAGES
printf "[he] [hi-IN] [hr] [hu] [hy-AM] [id]" >> $FILE_LANGUAGES
printf "[is] [it] [ja] [kk] [km] [kn] [ko] [ku]" >> $FILE_LANGUAGES
printf "[lij] [lt] [lv] [mai] [mk] [ml] [mr]" >> $FILE_LANGUAGES
printf "[ms] [nb-NO] [nl] [nn-NO] [or] [pa-IN]" >> $FILE_LANGUAGES
printf "[pl] [pt-BR] [pt-PT] [rm] [ro] [ru]" >> $FILE_LANGUAGES
printf "[si] [sk] [sl] [son] [sq] [sr] [sv-SE]" >> $FILE_LANGUAGES
printf "[sw] [ta] [te] [th] [tr] [uk] [vi] [xh]" >> $FILE_LANGUAGES
printf "[xpi] [zh-CN] [zh-TW] [zu]" >> $FILE_LANGUAGES
echo ""
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
cat $FILE_LANGUAGES
printf ""
printf -n "(Default: en-US) Type the language; " ; read LANG
echo ""
echo -n "(Default: en-US) Type the language; " ; read LANG
COUNT=1
# Check if the variable 'LANG' is empty.
@ -433,10 +415,10 @@ function check_other_installs_on_system(){
done
clear
printf ""
printf "Language '$LANG' is not valid, please, type any available language"
printf ""
printf "Press 'ENTER' to return"
echo ""
echo "Language '$LANG' is not valid, please, type any available language"
echo ""
echo -n "Press 'ENTER' to return "
read notlang
step2_choose_language
@ -452,9 +434,9 @@ function check_other_installs_on_system(){
function get_list_versions() {
clear
printf ""
printf "Getting information of available versions, please wait.."
printf ""
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
@ -464,14 +446,14 @@ function check_other_installs_on_system(){
curl "$HTTP_FIREFOX/latest-esr/linux-x86_64/en-US/" | grep "tar.bz2" | cut -d "-" -f 3 | cut -d "<" -f 1 > $TMP_FILE_ESR
error=$?
if [ $? -eq 0 ] ; then
printf "OK" > /dev/null
echo "OK" > /dev/null
step1_choose_version
else
clear
printf ""
printf "Error: Failed to obtain the required information from the server!"
printf "Connection Fail!"
printf ""
echo ""
echo "Error: Failed to obtain the required information from the server!"
echo "Connection Fail!"
echo ""
exit
fi
}
@ -484,18 +466,18 @@ function check_other_installs_on_system(){
DEFAULT=`cat $TMP_FILE_STABLE`
clear
printf ""
printf "[ Step 1/5 (Version) ]"
printf ""
printf "Available Versions:"
printf ""
printf "(1) - firefox-$FIREFOX_ESR (ESR)"
printf "(2) - firefox-$FIREFOX_STABLE (stable)"
printf "(3) - firefox-$FIREFOX_BETA (beta)"
printf ""
printf "(q) - quit"
printf ""
printf -n "(Default: firefox-$DEFAULT) Choose an option; " ; read VER
echo ""
echo "[ Step 1/5 (Version) ]"
echo ""
echo "Available Versions:"
echo ""
echo "(1) - firefox-$FIREFOX_ESR (ESR)"
echo "(2) - firefox-$FIREFOX_STABLE (stable)"
echo "(3) - firefox-$FIREFOX_BETA (beta)"
echo ""
echo "(q) - quit"
echo ""
echo -n "(Default: firefox-$DEFAULT) Choose an option; " ; read VER
if [ "$VER" == "1" -o "$VER" == "ESR" ] ; then
VERSION=$FIREFOX_ESR
@ -522,10 +504,10 @@ function check_other_installs_on_system(){
else
clear
printf ""
printf "Invalid option, please, choose any available version"
printf ""
printf "Press 'ENTER' to return"
echo ""
echo "Invalid option, please, choose any available version"
echo ""
echo -n "Press 'ENTER' to return "
read notversion
step1_choose_version
fi

View File

@ -2,19 +2,11 @@
# Script to install Thunderbird on GNU/Linux
# Created by clamsawd (clamsawd@openmailbox.org)
# Version 2.0
# Version 2.1
# Licensed by GPL v.2
# Last update: 24-08-2015
# Last update: 14-10-2015
# --------------------------------------
function printf(){
echo "$1" "$2"
}
function textprint(){
echo "$1"
}
# Check if 'user' is 'root'
user=$(whoami)
if [ "$user" == "root" ] ; then
@ -36,22 +28,22 @@ KERNEL=$(uname -s)
# Create Mozilla thunderbird shortcut after of install it.
function create_thunderbird_icon(){
textprint "[Desktop Entry]" > /usr/share/applications/thunderbird.desktop
#textprint "Encoding=UTF-8" >> /usr/share/applications/thunderbird.desktop
textprint "Name=Mozilla Thunderbird" >> /usr/share/applications/thunderbird.desktop
textprint "Comment=Mozilla Email Reader" >> /usr/share/applications/thunderbird.desktop
textprint "GenericName=Email Reader" >> /usr/share/applications/thunderbird.desktop
textprint "X-GNOME-FullName=Mozilla Thunderbird" >> /usr/share/applications/thunderbird.desktop
textprint "Exec=thunderbird %u" >> /usr/share/applications/thunderbird.desktop
textprint "Terminal=false" >> /usr/share/applications/thunderbird.desktop
textprint "X-MultipleArgs=false" >> /usr/share/applications/thunderbird.desktop
textprint "Type=Application" >> /usr/share/applications/thunderbird.desktop
textprint "Icon=/opt/thunderbird/chrome/icons/default/default48.png" >> /usr/share/applications/thunderbird.desktop
textprint "Categories=Network;WebBrowser;" >> /usr/share/applications/thunderbird.desktop
#textprint "StartupWMClass=thunderbird-bin" >> /usr/share/applications/thunderbird.desktop
textprint "StartupNotify=true" >> /usr/share/applications/thunderbird.desktop
echo "[Desktop Entry]" > /usr/share/applications/thunderbird.desktop
#echo "Encoding=UTF-8" >> /usr/share/applications/thunderbird.desktop
echo "Name=Mozilla Thunderbird" >> /usr/share/applications/thunderbird.desktop
echo "Comment=Mozilla Email Reader" >> /usr/share/applications/thunderbird.desktop
echo "GenericName=Email Reader" >> /usr/share/applications/thunderbird.desktop
echo "X-GNOME-FullName=Mozilla Thunderbird" >> /usr/share/applications/thunderbird.desktop
echo "Exec=thunderbird %u" >> /usr/share/applications/thunderbird.desktop
echo "Terminal=false" >> /usr/share/applications/thunderbird.desktop
echo "X-MultipleArgs=false" >> /usr/share/applications/thunderbird.desktop
echo "Type=Application" >> /usr/share/applications/thunderbird.desktop
echo "Icon=/opt/thunderbird/chrome/icons/default/default48.png" >> /usr/share/applications/thunderbird.desktop
echo "Categories=Network;WebBrowser;" >> /usr/share/applications/thunderbird.desktop
#echo "StartupWMClass=thunderbird-bin" >> /usr/share/applications/thunderbird.desktop
echo "StartupNotify=true" >> /usr/share/applications/thunderbird.desktop
chmod 755 /usr/share/applications/thunderbird.desktop
printf " <-Finished->"
echo " <-Finished->"
exit
}
@ -59,15 +51,15 @@ KERNEL=$(uname -s)
# initialize the 'create_THUNDERBIRD_icon' function.
function install_thunderbird(){
printf ""
printf " <-Downloading Mozilla Thunderbird->"
echo ""
echo " <-Downloading Mozilla Thunderbird->"
cd /tmp/
if [ "$APP_DOWNLOAD" == "curl" ] ; then
$APP_DOWNLOAD $SERVER > thunderbird-$VERSION
else
$APP_DOWNLOAD $SERVER
fi
printf " <-Installing Mozilla Thunderbird->"
echo " <-Installing Mozilla Thunderbird->"
tar jxvf thunderbird-$VERSION -C /opt/
rm -rf /usr/bin/thunderbird
ln -s /opt/thunderbird/thunderbird /usr/bin/thunderbird
@ -84,18 +76,18 @@ KERNEL=$(uname -s)
SERVER=http://archive.mozilla.org/pub/thunderbird/releases/$RELEASE/$ARCH/$LANGUAGE/thunderbird-$VERSION
clear
printf ""
printf "[Step 5/5] Check your selected installation:"
printf ""
printf "Install: Mozilla Thunderbird"
printf "Package: thunderbird-$VERSION"
printf "Language: $LANGUAGE"
printf "Arch: $ARCH"
printf "Directory: /opt/thunderbird/"
printf ""
printf "Apps: $NAME_APP (download) , tar (unpack) "
printf ""
printf -n "(default: y) Is correct (y/n/q); " ; read VAREND
echo ""
echo "[Step 5/5] Check your selected installation:"
echo ""
echo "Install: Mozilla Thunderbird"
echo "Package: thunderbird-$VERSION"
echo "Language: $LANGUAGE"
echo "Arch: $ARCH"
echo "Directory: /opt/thunderbird/"
echo ""
echo "Apps: $NAME_APP (download) , tar (unpack) "
echo ""
echo -n "(default: y) Is correct (y/n/q); " ; read VAREND
if [ "${VAREND:-NO_VALUE}" == "NO_VALUE" -o "$VAREND" == "yes" -o "$VAREND" == "y" ] ; then
install_thunderbird
@ -107,10 +99,10 @@ KERNEL=$(uname -s)
else
clear
printf ""
printf "Invalid option, please, choose any available option"
printf ""
printf "Press 'ENTER' to return"
echo ""
echo "Invalid option, please, choose any available option"
echo ""
echo -n "Press 'ENTER' to return "
read yesorno
step5_install_thunderbird
fi
@ -151,15 +143,15 @@ function check_other_installs_on_system(){
if [ -d /opt/thunderbird/ ]; then
clear
printf ""
printf "Detected a previous installation of Thunderbird"
printf "Do you want to overwrite or uninstall the current version?"
printf ""
printf "(1) - overwrite"
printf "(2) - uninstall"
printf "(3) - quit (q)"
printf ""
printf -n "(Default: overwrite) Choose an option; " ; read INST
echo ""
echo "Detected a previous installation of Thunderbird"
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
if [ "${INST:-NO_VALUE}" == "NO_VALUE" ] ; then
get_list_versions
@ -170,15 +162,15 @@ function check_other_installs_on_system(){
elif [ "$INST" == "2" -o "$INST" == "uninstall" ] ; then
clear
printf ""
printf "Uninstalling thunderbird, please wait..."
printf ""
echo ""
echo "Uninstalling thunderbird, please wait..."
echo ""
sleep 5
rm -rf /usr/bin/thunderbird
rm -rf /usr/share/applications/thunderbird.desktop
rm -rf /opt/thunderbird/
printf "Done!"
printf ""
echo "Done!"
echo ""
exit
elif [ "$INST" == "3" -o "$INST" == "quit" -o "$INST" == "q" ]; then
@ -186,10 +178,10 @@ function check_other_installs_on_system(){
else
clear
printf ""
printf "Invalid option, please, choose any available option"
printf ""
printf "Press 'ENTER' to return"
echo ""
echo "Invalid option, please, choose any available option"
echo ""
echo -n "Press 'ENTER' to return "
read notoption
check_other_installs_on_system
fi
@ -208,9 +200,9 @@ function check_other_installs_on_system(){
check_other_installs_on_system
else
clear
printf ""
printf "Error: Need 'curl' installed on your system!"
printf ""
echo ""
echo "Error: Need 'curl' installed on your system!"
echo ""
exit
fi
}
@ -221,20 +213,20 @@ function check_other_installs_on_system(){
function step4_choose_app_download(){
clear
printf ""
printf "[ Step 4/5 (App to download) ]"
printf ""
printf "Available apps to download:"
printf ""
printf "(1) - wget ($WGET)"
printf "(2) - aria2c ($ARIA2C)"
printf "(3) - axel ($AXEL)"
printf "(4) - curl (Available)"
printf ""
printf "(q) - quit"
printf ""
echo ""
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 "(4) - curl (Available)"
echo ""
echo "(q) - quit"
echo ""
APP=0
printf -n "(Default: wget) Choose an option; " ; read APP
echo -n "(Default: curl) Choose an option; " ; read APP
if [ "$APP" == "1" -o "$APP" == "wget" ] ; then
@ -246,10 +238,10 @@ function check_other_installs_on_system(){
step5_install_thunderbird
else
clear
printf ""
printf "'wget' is not available in your system"
printf ""
printf "Press 'ENTER' to return"
echo ""
echo "'wget' is not available in your system"
echo ""
echo -n "Press 'ENTER' to return "
read not
step4_choose_app_download
fi
@ -264,10 +256,10 @@ function check_other_installs_on_system(){
step5_install_thunderbird
else
clear
printf ""
printf "'aria2c' is not available in your system"
printf ""
printf "Press 'ENTER' to return"
echo ""
echo "'aria2c' is not available in your system"
echo ""
echo -n "Press 'ENTER' to return "
read not
step4_choose_app_download
fi
@ -282,10 +274,10 @@ function check_other_installs_on_system(){
step5_install_thunderbird
else
clear
printf ""
printf "'axel' is not available in your system"
printf ""
printf "Press 'ENTER' to return"
echo ""
echo "'axel' is not available in your system"
echo ""
echo -n "Press 'ENTER' to return "
read not
step4_choose_app_download
fi
@ -300,26 +292,16 @@ function check_other_installs_on_system(){
exit
elif [ "${APP:-NO_VALUE}" == "NO_VALUE" ] ; then
if [ "$WGET" == "Available" ]; then
APP_DOWNLOAD='wget -c'
NAME_APP='wget'
APP_DOWNLOAD='curl'
NAME_APP='curl'
step5_install_thunderbird
else
clear
printf ""
printf "'wget' is not available in your system"
printf ""
printf "Press 'ENTER' to return"
read not
step4_choose_app_download
fi
else
clear
printf ""
printf "Invalid option, please, choose any available app"
printf ""
printf "Press 'ENTER' to return"
echo ""
echo "Invalid option, please, choose any available app"
echo ""
echo -n "Press 'ENTER' to return "
read notapp
step4_choose_app_download
fi
@ -330,17 +312,17 @@ function check_other_installs_on_system(){
function step3_choose_arch(){
clear
printf ""
printf "[ Step 3/5 (Arch) ]"
printf ""
printf "Available Arch:"
printf ""
printf "(1) - 32 bits (linux-i686)"
printf "(2) - 64 bits (linux-x86_64)"
printf ""
printf "(q) - quit"
printf ""
printf -n "(Default: autodetect) Choose an option; " ; read AR
echo ""
echo "[ Step 3/5 (Arch) ]"
echo ""
echo "Available Arch:"
echo ""
echo "(1) - 32 bits (linux-i686)"
echo "(2) - 64 bits (linux-x86_64)"
echo ""
echo "(q) - quit"
echo ""
echo -n "(Default: autodetect) Choose an option; " ; read AR
if [ "${AR:-NO_VALUE}" == "NO_VALUE" ] ; then
@ -374,10 +356,10 @@ function check_other_installs_on_system(){
else
clear
printf ""
printf "Invalid option, please, choose any available arch"
printf ""
printf "Press 'ENTER' to return"
echo ""
echo "Invalid option, please, choose any available arch"
echo ""
echo -n "Press 'ENTER' to return "
read notarch
step3_choose_arch
fi
@ -389,28 +371,28 @@ function check_other_installs_on_system(){
FILE_LANGUAGES=/tmp/thunderbird-languages
clear
printf ""
printf "[ Step 2/5 (Language) ]"
printf ""
printf "Available languages:"
printf ""
printf "[ach] [af] [an] [ar] [as] [ast] [be]" > $FILE_LANGUAGES
printf "[bg] [bn-BD] [bn-IN] [br] [bs] [ca]" >> $FILE_LANGUAGES
printf "[cs] [csb] [cy] [da] [de] [el] [en-GB]" >> $FILE_LANGUAGES
printf "[en-US] [en-ZA] [eo] [es-AR] [es-CL]" >> $FILE_LANGUAGES
printf "[es-ES] [es-MX] [et] [eu] [fa] [ff] [fi]" >> $FILE_LANGUAGES
printf "[fr] [fy-NL] [ga-IE] [gd] [gl] [gu-IN]" >> $FILE_LANGUAGES
printf "[he] [hi-IN] [hr] [hu] [hy-AM] [id]" >> $FILE_LANGUAGES
printf "[is] [it] [ja] [kk] [km] [kn] [ko] [ku]" >> $FILE_LANGUAGES
printf "[lij] [lt] [lv] [mai] [mk] [ml] [mr]" >> $FILE_LANGUAGES
printf "[ms] [nb-NO] [nl] [nn-NO] [or] [pa-IN]" >> $FILE_LANGUAGES
printf "[pl] [pt-BR] [pt-PT] [rm] [ro] [ru]" >> $FILE_LANGUAGES
printf "[si] [sk] [sl] [son] [sq] [sr] [sv-SE]" >> $FILE_LANGUAGES
printf "[sw] [ta] [te] [th] [tr] [uk] [vi] [xh]" >> $FILE_LANGUAGES
printf "[xpi] [zh-CN] [zh-TW] [zu]" >> $FILE_LANGUAGES
echo ""
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
cat $FILE_LANGUAGES
printf ""
printf -n "(Default: en-US) Type the language; " ; read LANG
echo ""
echo -n "(Default: en-US) Type the language; " ; read LANG
COUNT=1
# Check if the variable 'LANG' is empty.
@ -433,10 +415,10 @@ function check_other_installs_on_system(){
done
clear
printf ""
printf "Language '$LANG' is not valid, please, type any available language"
printf ""
printf "Press 'ENTER' to return"
echo ""
echo "Language '$LANG' is not valid, please, type any available language"
echo ""
echo -n "Press 'ENTER' to return "
read notlang
step2_choose_language
@ -452,9 +434,9 @@ function check_other_installs_on_system(){
function get_list_versions() {
clear
printf ""
printf "Getting information of available versions, please wait.."
printf ""
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
@ -464,14 +446,14 @@ function check_other_installs_on_system(){
curl "$HTTP_THUNDERBIRD/latest-esr/linux-x86_64/en-US/" | grep "tar.bz2" | cut -d "-" -f 3 | cut -d "<" -f 1 > $TMP_FILE_ESR
error=$?
if [ $? -eq 0 ] ; then
printf "OK" > /dev/null
echo "OK" > /dev/null
step1_choose_version
else
clear
printf ""
printf "Error: Failed to obtain the required information from the server!"
printf "Connection Fail!"
printf ""
echo ""
echo "Error: Failed to obtain the required information from the server!"
echo "Connection Fail!"
echo ""
exit
fi
}
@ -484,18 +466,18 @@ function check_other_installs_on_system(){
DEFAULT=`cat $TMP_FILE_STABLE`
clear
printf ""
printf "[ Step 1/5 (Version) ]"
printf ""
printf "Available Versions:"
printf ""
printf "(1) - thunderbird-$THUNDERBIRD_ESR (ESR)"
printf "(2) - thunderbird-$THUNDERBIRD_STABLE (stable)"
printf "(3) - thunderbird-$THUNDERBIRD_BETA (beta)"
printf ""
printf "(q) - quit"
printf ""
printf -n "(Default: thunderbird-$DEFAULT) Choose an option; " ; read VER
echo ""
echo "[ Step 1/5 (Version) ]"
echo ""
echo "Available Versions:"
echo ""
echo "(1) - thunderbird-$THUNDERBIRD_ESR (ESR)"
echo "(2) - thunderbird-$THUNDERBIRD_STABLE (stable)"
echo "(3) - thunderbird-$THUNDERBIRD_BETA (beta)"
echo ""
echo "(q) - quit"
echo ""
echo -n "(Default: thunderbird-$DEFAULT) Choose an option; " ; read VER
if [ "$VER" == "1" -o "$VER" == "ESR" ] ; then
VERSION=$THUNDERBIRD_ESR
@ -522,10 +504,10 @@ function check_other_installs_on_system(){
else
clear
printf ""
printf "Invalid option, please, choose any available version"
printf ""
printf "Press 'ENTER' to return"
echo ""
echo "Invalid option, please, choose any available version"
echo ""
echo -n "Press 'ENTER' to return "
read notversion
step1_choose_version
fi