update firefox istall hook to work in 32 and 64 bit
This commit is contained in:
parent
0cc3dfae47
commit
4f3b8ac730
|
@ -1,28 +1,47 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Script adapted for use as a hook in Debian Live-Build
|
# Script for use as a hook in Debian Live-Build
|
||||||
# to install Firefox with all available language packs
|
# to install Firefox with all available language packs
|
||||||
|
# Supports both 32-bit and 64-bit architectures
|
||||||
|
|
||||||
# Set default locale to English (US) for initial Firefox download
|
# Function to download and install Firefox
|
||||||
default_locale="en-US"
|
install_firefox() {
|
||||||
|
local architecture="$1"
|
||||||
|
local default_locale="en-US"
|
||||||
|
|
||||||
# Download the latest version of Firefox
|
# Determine the appropriate URL and file paths based on architecture
|
||||||
firefox_version=$(curl -sL "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${default_locale}" | grep -o 'firefox-[0-9.]*.tar.bz2' | sed 's/firefox-//g' | sed 's/.tar.bz2//g')
|
if [ "$architecture" == "32bit" ]; then
|
||||||
firefox_filename="firefox-${firefox_version}.tar.bz2"
|
arch_url="linux"
|
||||||
wget -O /tmp/${firefox_filename} "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${default_locale}"
|
lang_pack_arch="linux-i686"
|
||||||
|
else
|
||||||
|
arch_url="linux64"
|
||||||
|
lang_pack_arch="linux-x86_64"
|
||||||
|
fi
|
||||||
|
|
||||||
# Extract and install Firefox
|
# URL to download the latest Firefox
|
||||||
tar -C /opt -xvf /tmp/${firefox_filename}
|
firefox_url="https://download.mozilla.org/?product=firefox-latest&os=${arch_url}&lang=${default_locale}"
|
||||||
|
|
||||||
# Create a symbolic link for Firefox
|
# Get the latest version number
|
||||||
ln -sf /opt/firefox/firefox /usr/bin/firefox
|
firefox_version=$(curl -sL ${firefox_url} | grep -o 'firefox-[0-9.]*.tar.bz2' | sed 's/firefox-//g' | sed 's/.tar.bz2//g')
|
||||||
|
|
||||||
# Set permissions to allow automatic updates
|
# Construct the filename for download
|
||||||
chmod -R 775 /opt/firefox
|
firefox_filename="firefox-${firefox_version}.tar.bz2"
|
||||||
chown -R root:users /opt/firefox
|
|
||||||
|
|
||||||
# Create a .desktop entry for Firefox
|
# Download the latest version of Firefox
|
||||||
echo "[Desktop Entry]
|
wget -O /tmp/${firefox_filename} ${firefox_url}
|
||||||
|
|
||||||
|
# Extract and install Firefox to /opt/firefox
|
||||||
|
tar -C /opt -xvf /tmp/${firefox_filename}
|
||||||
|
|
||||||
|
# Create a symbolic link for Firefox in /usr/bin
|
||||||
|
ln -sf /opt/firefox/firefox /usr/bin/firefox
|
||||||
|
|
||||||
|
# Set permissions to allow automatic updates
|
||||||
|
chmod -R 775 /opt/firefox
|
||||||
|
chown -R root:users /opt/firefox
|
||||||
|
|
||||||
|
# Create a .desktop entry for Firefox
|
||||||
|
echo "[Desktop Entry]
|
||||||
Name=Firefox
|
Name=Firefox
|
||||||
Comment=Web Browser
|
Comment=Web Browser
|
||||||
GenericName=Web Browser
|
GenericName=Web Browser
|
||||||
|
@ -34,30 +53,40 @@ Categories=Network;WebBrowser;
|
||||||
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;
|
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;
|
||||||
StartupNotify=true" > /usr/share/applications/firefox.desktop
|
StartupNotify=true" > /usr/share/applications/firefox.desktop
|
||||||
|
|
||||||
# Download and install all available language packs
|
# Download and install all available language packs
|
||||||
lang_pack_base_url="https://archive.mozilla.org/pub/firefox/releases/${firefox_version}/linux-x86_64/xpi"
|
lang_pack_base_url="https://archive.mozilla.org/pub/firefox/releases/${firefox_version}/${lang_pack_arch}/xpi"
|
||||||
tmp_dir="/tmp/firefox-languages"
|
tmp_dir="/tmp/firefox-languages"
|
||||||
|
|
||||||
# Create a temporary directory for language packs
|
# Create a temporary directory for language packs
|
||||||
mkdir -p ${tmp_dir}
|
mkdir -p ${tmp_dir}
|
||||||
|
|
||||||
# List of all language codes available for Firefox
|
# List of all language codes available for Firefox
|
||||||
lang_codes=$(curl -sL ${lang_pack_base_url}/ | grep -oP 'href="\K[^"]+?\.xpi' | sed 's/\.xpi//')
|
lang_codes=$(curl -sL ${lang_pack_base_url}/ | grep -oP 'href="\K[^"]+?\.xpi' | sed 's/\.xpi//')
|
||||||
|
|
||||||
# Loop through each language code and download the language pack
|
# Loop through each language code and download the language pack
|
||||||
for lang_code in ${lang_codes}; do
|
for lang_code in ${lang_codes}; do
|
||||||
wget -O ${tmp_dir}/${lang_code}.xpi ${lang_pack_base_url}/${lang_code}.xpi
|
wget -O ${tmp_dir}/${lang_code}.xpi ${lang_pack_base_url}/${lang_code}.xpi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Create the directory for language packs in the Firefox installation
|
# Create the directory for language packs in the Firefox installation
|
||||||
lang_pack_dir="/opt/firefox/browser/extensions"
|
lang_pack_dir="/opt/firefox/browser/extensions"
|
||||||
|
|
||||||
# Move all language packs to the Firefox extensions directory
|
# Move all language packs to the Firefox extensions directory
|
||||||
mkdir -p ${lang_pack_dir}
|
mkdir -p ${lang_pack_dir}
|
||||||
mv ${tmp_dir}/*.xpi ${lang_pack_dir}
|
mv ${tmp_dir}/*.xpi ${lang_pack_dir}
|
||||||
|
|
||||||
# Clean up the temporary directory
|
# Clean up the temporary directory
|
||||||
rm -rf ${tmp_dir}
|
rm -rf ${tmp_dir}
|
||||||
|
|
||||||
echo "Firefox latest installed successfully with all language packs and is ready for auto-updates."
|
echo "Firefox latest ${architecture} installed successfully with all language packs and is ready for auto-updates."
|
||||||
|
}
|
||||||
|
|
||||||
|
# Detect system architecture and install the appropriate version
|
||||||
|
if [ "$(uname -m)" == "x86_64" ]; then
|
||||||
|
echo "Installing Firefox for 64-bit architecture"
|
||||||
|
install_firefox "64bit"
|
||||||
|
else
|
||||||
|
echo "Installing Firefox for 32-bit architecture"
|
||||||
|
install_firefox "32bit"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
|
@ -1,28 +1,47 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Script adapted for use as a hook in Debian Live-Build
|
# Script for use as a hook in Debian Live-Build
|
||||||
# to install Firefox with all available language packs
|
# to install Firefox with all available language packs
|
||||||
|
# Supports both 32-bit and 64-bit architectures
|
||||||
|
|
||||||
# Set default locale to English (US) for initial Firefox download
|
# Function to download and install Firefox
|
||||||
default_locale="en-US"
|
install_firefox() {
|
||||||
|
local architecture="$1"
|
||||||
|
local default_locale="en-US"
|
||||||
|
|
||||||
# Download the latest version of Firefox
|
# Determine the appropriate URL and file paths based on architecture
|
||||||
firefox_version=$(curl -sL "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${default_locale}" | grep -o 'firefox-[0-9.]*.tar.bz2' | sed 's/firefox-//g' | sed 's/.tar.bz2//g')
|
if [ "$architecture" == "32bit" ]; then
|
||||||
firefox_filename="firefox-${firefox_version}.tar.bz2"
|
arch_url="linux"
|
||||||
wget -O /tmp/${firefox_filename} "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${default_locale}"
|
lang_pack_arch="linux-i686"
|
||||||
|
else
|
||||||
|
arch_url="linux64"
|
||||||
|
lang_pack_arch="linux-x86_64"
|
||||||
|
fi
|
||||||
|
|
||||||
# Extract and install Firefox
|
# URL to download the latest Firefox
|
||||||
tar -C /opt -xvf /tmp/${firefox_filename}
|
firefox_url="https://download.mozilla.org/?product=firefox-latest&os=${arch_url}&lang=${default_locale}"
|
||||||
|
|
||||||
# Create a symbolic link for Firefox
|
# Get the latest version number
|
||||||
ln -sf /opt/firefox/firefox /usr/bin/firefox
|
firefox_version=$(curl -sL ${firefox_url} | grep -o 'firefox-[0-9.]*.tar.bz2' | sed 's/firefox-//g' | sed 's/.tar.bz2//g')
|
||||||
|
|
||||||
# Set permissions to allow automatic updates
|
# Construct the filename for download
|
||||||
chmod -R 775 /opt/firefox
|
firefox_filename="firefox-${firefox_version}.tar.bz2"
|
||||||
chown -R root:users /opt/firefox
|
|
||||||
|
|
||||||
# Create a .desktop entry for Firefox
|
# Download the latest version of Firefox
|
||||||
echo "[Desktop Entry]
|
wget -O /tmp/${firefox_filename} ${firefox_url}
|
||||||
|
|
||||||
|
# Extract and install Firefox to /opt/firefox
|
||||||
|
tar -C /opt -xvf /tmp/${firefox_filename}
|
||||||
|
|
||||||
|
# Create a symbolic link for Firefox in /usr/bin
|
||||||
|
ln -sf /opt/firefox/firefox /usr/bin/firefox
|
||||||
|
|
||||||
|
# Set permissions to allow automatic updates
|
||||||
|
chmod -R 775 /opt/firefox
|
||||||
|
chown -R root:users /opt/firefox
|
||||||
|
|
||||||
|
# Create a .desktop entry for Firefox
|
||||||
|
echo "[Desktop Entry]
|
||||||
Name=Firefox
|
Name=Firefox
|
||||||
Comment=Web Browser
|
Comment=Web Browser
|
||||||
GenericName=Web Browser
|
GenericName=Web Browser
|
||||||
|
@ -34,30 +53,40 @@ Categories=Network;WebBrowser;
|
||||||
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;
|
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;
|
||||||
StartupNotify=true" > /usr/share/applications/firefox.desktop
|
StartupNotify=true" > /usr/share/applications/firefox.desktop
|
||||||
|
|
||||||
# Download and install all available language packs
|
# Download and install all available language packs
|
||||||
lang_pack_base_url="https://archive.mozilla.org/pub/firefox/releases/${firefox_version}/linux-x86_64/xpi"
|
lang_pack_base_url="https://archive.mozilla.org/pub/firefox/releases/${firefox_version}/${lang_pack_arch}/xpi"
|
||||||
tmp_dir="/tmp/firefox-languages"
|
tmp_dir="/tmp/firefox-languages"
|
||||||
|
|
||||||
# Create a temporary directory for language packs
|
# Create a temporary directory for language packs
|
||||||
mkdir -p ${tmp_dir}
|
mkdir -p ${tmp_dir}
|
||||||
|
|
||||||
# List of all language codes available for Firefox
|
# List of all language codes available for Firefox
|
||||||
lang_codes=$(curl -sL ${lang_pack_base_url}/ | grep -oP 'href="\K[^"]+?\.xpi' | sed 's/\.xpi//')
|
lang_codes=$(curl -sL ${lang_pack_base_url}/ | grep -oP 'href="\K[^"]+?\.xpi' | sed 's/\.xpi//')
|
||||||
|
|
||||||
# Loop through each language code and download the language pack
|
# Loop through each language code and download the language pack
|
||||||
for lang_code in ${lang_codes}; do
|
for lang_code in ${lang_codes}; do
|
||||||
wget -O ${tmp_dir}/${lang_code}.xpi ${lang_pack_base_url}/${lang_code}.xpi
|
wget -O ${tmp_dir}/${lang_code}.xpi ${lang_pack_base_url}/${lang_code}.xpi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Create the directory for language packs in the Firefox installation
|
# Create the directory for language packs in the Firefox installation
|
||||||
lang_pack_dir="/opt/firefox/browser/extensions"
|
lang_pack_dir="/opt/firefox/browser/extensions"
|
||||||
|
|
||||||
# Move all language packs to the Firefox extensions directory
|
# Move all language packs to the Firefox extensions directory
|
||||||
mkdir -p ${lang_pack_dir}
|
mkdir -p ${lang_pack_dir}
|
||||||
mv ${tmp_dir}/*.xpi ${lang_pack_dir}
|
mv ${tmp_dir}/*.xpi ${lang_pack_dir}
|
||||||
|
|
||||||
# Clean up the temporary directory
|
# Clean up the temporary directory
|
||||||
rm -rf ${tmp_dir}
|
rm -rf ${tmp_dir}
|
||||||
|
|
||||||
echo "Firefox latest installed successfully with all language packs and is ready for auto-updates."
|
echo "Firefox latest ${architecture} installed successfully with all language packs and is ready for auto-updates."
|
||||||
|
}
|
||||||
|
|
||||||
|
# Detect system architecture and install the appropriate version
|
||||||
|
if [ "$(uname -m)" == "x86_64" ]; then
|
||||||
|
echo "Installing Firefox for 64-bit architecture"
|
||||||
|
install_firefox "64bit"
|
||||||
|
else
|
||||||
|
echo "Installing Firefox for 32-bit architecture"
|
||||||
|
install_firefox "32bit"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
|
@ -1,28 +1,47 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Script adapted for use as a hook in Debian Live-Build
|
# Script for use as a hook in Debian Live-Build
|
||||||
# to install Firefox with all available language packs
|
# to install Firefox with all available language packs
|
||||||
|
# Supports both 32-bit and 64-bit architectures
|
||||||
|
|
||||||
# Set default locale to English (US) for initial Firefox download
|
# Function to download and install Firefox
|
||||||
default_locale="en-US"
|
install_firefox() {
|
||||||
|
local architecture="$1"
|
||||||
|
local default_locale="en-US"
|
||||||
|
|
||||||
# Download the latest version of Firefox
|
# Determine the appropriate URL and file paths based on architecture
|
||||||
firefox_version=$(curl -sL "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${default_locale}" | grep -o 'firefox-[0-9.]*.tar.bz2' | sed 's/firefox-//g' | sed 's/.tar.bz2//g')
|
if [ "$architecture" == "32bit" ]; then
|
||||||
firefox_filename="firefox-${firefox_version}.tar.bz2"
|
arch_url="linux"
|
||||||
wget -O /tmp/${firefox_filename} "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${default_locale}"
|
lang_pack_arch="linux-i686"
|
||||||
|
else
|
||||||
|
arch_url="linux64"
|
||||||
|
lang_pack_arch="linux-x86_64"
|
||||||
|
fi
|
||||||
|
|
||||||
# Extract and install Firefox
|
# URL to download the latest Firefox
|
||||||
tar -C /opt -xvf /tmp/${firefox_filename}
|
firefox_url="https://download.mozilla.org/?product=firefox-latest&os=${arch_url}&lang=${default_locale}"
|
||||||
|
|
||||||
# Create a symbolic link for Firefox
|
# Get the latest version number
|
||||||
ln -sf /opt/firefox/firefox /usr/bin/firefox
|
firefox_version=$(curl -sL ${firefox_url} | grep -o 'firefox-[0-9.]*.tar.bz2' | sed 's/firefox-//g' | sed 's/.tar.bz2//g')
|
||||||
|
|
||||||
# Set permissions to allow automatic updates
|
# Construct the filename for download
|
||||||
chmod -R 775 /opt/firefox
|
firefox_filename="firefox-${firefox_version}.tar.bz2"
|
||||||
chown -R root:users /opt/firefox
|
|
||||||
|
|
||||||
# Create a .desktop entry for Firefox
|
# Download the latest version of Firefox
|
||||||
echo "[Desktop Entry]
|
wget -O /tmp/${firefox_filename} ${firefox_url}
|
||||||
|
|
||||||
|
# Extract and install Firefox to /opt/firefox
|
||||||
|
tar -C /opt -xvf /tmp/${firefox_filename}
|
||||||
|
|
||||||
|
# Create a symbolic link for Firefox in /usr/bin
|
||||||
|
ln -sf /opt/firefox/firefox /usr/bin/firefox
|
||||||
|
|
||||||
|
# Set permissions to allow automatic updates
|
||||||
|
chmod -R 775 /opt/firefox
|
||||||
|
chown -R root:users /opt/firefox
|
||||||
|
|
||||||
|
# Create a .desktop entry for Firefox
|
||||||
|
echo "[Desktop Entry]
|
||||||
Name=Firefox
|
Name=Firefox
|
||||||
Comment=Web Browser
|
Comment=Web Browser
|
||||||
GenericName=Web Browser
|
GenericName=Web Browser
|
||||||
|
@ -34,30 +53,40 @@ Categories=Network;WebBrowser;
|
||||||
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;
|
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;
|
||||||
StartupNotify=true" > /usr/share/applications/firefox.desktop
|
StartupNotify=true" > /usr/share/applications/firefox.desktop
|
||||||
|
|
||||||
# Download and install all available language packs
|
# Download and install all available language packs
|
||||||
lang_pack_base_url="https://archive.mozilla.org/pub/firefox/releases/${firefox_version}/linux-x86_64/xpi"
|
lang_pack_base_url="https://archive.mozilla.org/pub/firefox/releases/${firefox_version}/${lang_pack_arch}/xpi"
|
||||||
tmp_dir="/tmp/firefox-languages"
|
tmp_dir="/tmp/firefox-languages"
|
||||||
|
|
||||||
# Create a temporary directory for language packs
|
# Create a temporary directory for language packs
|
||||||
mkdir -p ${tmp_dir}
|
mkdir -p ${tmp_dir}
|
||||||
|
|
||||||
# List of all language codes available for Firefox
|
# List of all language codes available for Firefox
|
||||||
lang_codes=$(curl -sL ${lang_pack_base_url}/ | grep -oP 'href="\K[^"]+?\.xpi' | sed 's/\.xpi//')
|
lang_codes=$(curl -sL ${lang_pack_base_url}/ | grep -oP 'href="\K[^"]+?\.xpi' | sed 's/\.xpi//')
|
||||||
|
|
||||||
# Loop through each language code and download the language pack
|
# Loop through each language code and download the language pack
|
||||||
for lang_code in ${lang_codes}; do
|
for lang_code in ${lang_codes}; do
|
||||||
wget -O ${tmp_dir}/${lang_code}.xpi ${lang_pack_base_url}/${lang_code}.xpi
|
wget -O ${tmp_dir}/${lang_code}.xpi ${lang_pack_base_url}/${lang_code}.xpi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Create the directory for language packs in the Firefox installation
|
# Create the directory for language packs in the Firefox installation
|
||||||
lang_pack_dir="/opt/firefox/browser/extensions"
|
lang_pack_dir="/opt/firefox/browser/extensions"
|
||||||
|
|
||||||
# Move all language packs to the Firefox extensions directory
|
# Move all language packs to the Firefox extensions directory
|
||||||
mkdir -p ${lang_pack_dir}
|
mkdir -p ${lang_pack_dir}
|
||||||
mv ${tmp_dir}/*.xpi ${lang_pack_dir}
|
mv ${tmp_dir}/*.xpi ${lang_pack_dir}
|
||||||
|
|
||||||
# Clean up the temporary directory
|
# Clean up the temporary directory
|
||||||
rm -rf ${tmp_dir}
|
rm -rf ${tmp_dir}
|
||||||
|
|
||||||
echo "Firefox latest installed successfully with all language packs and is ready for auto-updates."
|
echo "Firefox latest ${architecture} installed successfully with all language packs and is ready for auto-updates."
|
||||||
|
}
|
||||||
|
|
||||||
|
# Detect system architecture and install the appropriate version
|
||||||
|
if [ "$(uname -m)" == "x86_64" ]; then
|
||||||
|
echo "Installing Firefox for 64-bit architecture"
|
||||||
|
install_firefox "64bit"
|
||||||
|
else
|
||||||
|
echo "Installing Firefox for 32-bit architecture"
|
||||||
|
install_firefox "32bit"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
|
@ -1,28 +1,47 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Script adapted for use as a hook in Debian Live-Build
|
# Script for use as a hook in Debian Live-Build
|
||||||
# to install Firefox with all available language packs
|
# to install Firefox with all available language packs
|
||||||
|
# Supports both 32-bit and 64-bit architectures
|
||||||
|
|
||||||
# Set default locale to English (US) for initial Firefox download
|
# Function to download and install Firefox
|
||||||
default_locale="en-US"
|
install_firefox() {
|
||||||
|
local architecture="$1"
|
||||||
|
local default_locale="en-US"
|
||||||
|
|
||||||
# Download the latest version of Firefox
|
# Determine the appropriate URL and file paths based on architecture
|
||||||
firefox_version=$(curl -sL "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${default_locale}" | grep -o 'firefox-[0-9.]*.tar.bz2' | sed 's/firefox-//g' | sed 's/.tar.bz2//g')
|
if [ "$architecture" == "32bit" ]; then
|
||||||
firefox_filename="firefox-${firefox_version}.tar.bz2"
|
arch_url="linux"
|
||||||
wget -O /tmp/${firefox_filename} "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${default_locale}"
|
lang_pack_arch="linux-i686"
|
||||||
|
else
|
||||||
|
arch_url="linux64"
|
||||||
|
lang_pack_arch="linux-x86_64"
|
||||||
|
fi
|
||||||
|
|
||||||
# Extract and install Firefox
|
# URL to download the latest Firefox
|
||||||
tar -C /opt -xvf /tmp/${firefox_filename}
|
firefox_url="https://download.mozilla.org/?product=firefox-latest&os=${arch_url}&lang=${default_locale}"
|
||||||
|
|
||||||
# Create a symbolic link for Firefox
|
# Get the latest version number
|
||||||
ln -sf /opt/firefox/firefox /usr/bin/firefox
|
firefox_version=$(curl -sL ${firefox_url} | grep -o 'firefox-[0-9.]*.tar.bz2' | sed 's/firefox-//g' | sed 's/.tar.bz2//g')
|
||||||
|
|
||||||
# Set permissions to allow automatic updates
|
# Construct the filename for download
|
||||||
chmod -R 775 /opt/firefox
|
firefox_filename="firefox-${firefox_version}.tar.bz2"
|
||||||
chown -R root:users /opt/firefox
|
|
||||||
|
|
||||||
# Create a .desktop entry for Firefox
|
# Download the latest version of Firefox
|
||||||
echo "[Desktop Entry]
|
wget -O /tmp/${firefox_filename} ${firefox_url}
|
||||||
|
|
||||||
|
# Extract and install Firefox to /opt/firefox
|
||||||
|
tar -C /opt -xvf /tmp/${firefox_filename}
|
||||||
|
|
||||||
|
# Create a symbolic link for Firefox in /usr/bin
|
||||||
|
ln -sf /opt/firefox/firefox /usr/bin/firefox
|
||||||
|
|
||||||
|
# Set permissions to allow automatic updates
|
||||||
|
chmod -R 775 /opt/firefox
|
||||||
|
chown -R root:users /opt/firefox
|
||||||
|
|
||||||
|
# Create a .desktop entry for Firefox
|
||||||
|
echo "[Desktop Entry]
|
||||||
Name=Firefox
|
Name=Firefox
|
||||||
Comment=Web Browser
|
Comment=Web Browser
|
||||||
GenericName=Web Browser
|
GenericName=Web Browser
|
||||||
|
@ -34,30 +53,40 @@ Categories=Network;WebBrowser;
|
||||||
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;
|
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;
|
||||||
StartupNotify=true" > /usr/share/applications/firefox.desktop
|
StartupNotify=true" > /usr/share/applications/firefox.desktop
|
||||||
|
|
||||||
# Download and install all available language packs
|
# Download and install all available language packs
|
||||||
lang_pack_base_url="https://archive.mozilla.org/pub/firefox/releases/${firefox_version}/linux-x86_64/xpi"
|
lang_pack_base_url="https://archive.mozilla.org/pub/firefox/releases/${firefox_version}/${lang_pack_arch}/xpi"
|
||||||
tmp_dir="/tmp/firefox-languages"
|
tmp_dir="/tmp/firefox-languages"
|
||||||
|
|
||||||
# Create a temporary directory for language packs
|
# Create a temporary directory for language packs
|
||||||
mkdir -p ${tmp_dir}
|
mkdir -p ${tmp_dir}
|
||||||
|
|
||||||
# List of all language codes available for Firefox
|
# List of all language codes available for Firefox
|
||||||
lang_codes=$(curl -sL ${lang_pack_base_url}/ | grep -oP 'href="\K[^"]+?\.xpi' | sed 's/\.xpi//')
|
lang_codes=$(curl -sL ${lang_pack_base_url}/ | grep -oP 'href="\K[^"]+?\.xpi' | sed 's/\.xpi//')
|
||||||
|
|
||||||
# Loop through each language code and download the language pack
|
# Loop through each language code and download the language pack
|
||||||
for lang_code in ${lang_codes}; do
|
for lang_code in ${lang_codes}; do
|
||||||
wget -O ${tmp_dir}/${lang_code}.xpi ${lang_pack_base_url}/${lang_code}.xpi
|
wget -O ${tmp_dir}/${lang_code}.xpi ${lang_pack_base_url}/${lang_code}.xpi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Create the directory for language packs in the Firefox installation
|
# Create the directory for language packs in the Firefox installation
|
||||||
lang_pack_dir="/opt/firefox/browser/extensions"
|
lang_pack_dir="/opt/firefox/browser/extensions"
|
||||||
|
|
||||||
# Move all language packs to the Firefox extensions directory
|
# Move all language packs to the Firefox extensions directory
|
||||||
mkdir -p ${lang_pack_dir}
|
mkdir -p ${lang_pack_dir}
|
||||||
mv ${tmp_dir}/*.xpi ${lang_pack_dir}
|
mv ${tmp_dir}/*.xpi ${lang_pack_dir}
|
||||||
|
|
||||||
# Clean up the temporary directory
|
# Clean up the temporary directory
|
||||||
rm -rf ${tmp_dir}
|
rm -rf ${tmp_dir}
|
||||||
|
|
||||||
echo "Firefox latest installed successfully with all language packs and is ready for auto-updates."
|
echo "Firefox latest ${architecture} installed successfully with all language packs and is ready for auto-updates."
|
||||||
|
}
|
||||||
|
|
||||||
|
# Detect system architecture and install the appropriate version
|
||||||
|
if [ "$(uname -m)" == "x86_64" ]; then
|
||||||
|
echo "Installing Firefox for 64-bit architecture"
|
||||||
|
install_firefox "64bit"
|
||||||
|
else
|
||||||
|
echo "Installing Firefox for 32-bit architecture"
|
||||||
|
install_firefox "32bit"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue