Install Firefox and Thunderbird Automatically on Debian

Posted on Oct 22, 2014 in Software

Things under legendu.net/outdated are outdated technologies that the author does not plan to update any more. Please look for better alternatives.

** Things under legendu.net/outdated are outdated technologies that the author does not plan to update any more. Please look for better alternatives. **

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash

# download latest thunderbird
path=ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/latest/linux-$(uname -m)/en-US/
dir=$(mktemp -d)
echo "Temporary directory \"$dir\" is created."
cd $dir
echo "Downloading thunderbird into \"$dir\" ..."
wget -r --no-parent -e robots=off http://$path
path=$(ls $path/thunderbird-*)
filename=$(basename $path)
cp $path $filename
# decompress thunderbird installation files
echo "Decompressing thunderbird installation file ..."
if [ "$filename" == *.tar.bz2 ]; then
    option=-jxvf
elif [ "$filename" == *.tar.gz ]; then
    option=-zxvf
else
    echo "Unrecognized installation file!"
    return 1
fi
tar $option $filename
# copy to /opt
echo "Copying thunderbird to /opt ..."
sudo rm -rf /opt/thunderbird
sudo cp -r thunderbird /opt/
# uninstall icedove
if [ "$(wajig list | grep -i icedove)" != "" ]; then
    # wajig purge -y icedove
    echo "Please uninstall icedove."
fi