update firefox istall hook to work in 32 and 64 bit

This commit is contained in:
manuel 2024-06-16 18:36:44 +00:00
parent 0cc3dfae47
commit 4f3b8ac730
4 changed files with 256 additions and 140 deletions

View File

@ -1,20 +1,39 @@
#!/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
# Supports both 32-bit and 64-bit architectures
# Set default locale to English (US) for initial Firefox download
default_locale="en-US"
# Function to download and install Firefox
install_firefox() {
local architecture="$1"
local default_locale="en-US"
# Determine the appropriate URL and file paths based on architecture
if [ "$architecture" == "32bit" ]; then
arch_url="linux"
lang_pack_arch="linux-i686"
else
arch_url="linux64"
lang_pack_arch="linux-x86_64"
fi
# URL to download the latest Firefox
firefox_url="https://download.mozilla.org/?product=firefox-latest&os=${arch_url}&lang=${default_locale}"
# Get the latest version number
firefox_version=$(curl -sL ${firefox_url} | grep -o 'firefox-[0-9.]*.tar.bz2' | sed 's/firefox-//g' | sed 's/.tar.bz2//g')
# Construct the filename for download
firefox_filename="firefox-${firefox_version}.tar.bz2"
# Download the latest version of Firefox
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')
firefox_filename="firefox-${firefox_version}.tar.bz2"
wget -O /tmp/${firefox_filename} "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${default_locale}"
wget -O /tmp/${firefox_filename} ${firefox_url}
# Extract and install Firefox
# Extract and install Firefox to /opt/firefox
tar -C /opt -xvf /tmp/${firefox_filename}
# Create a symbolic link for Firefox
# Create a symbolic link for Firefox in /usr/bin
ln -sf /opt/firefox/firefox /usr/bin/firefox
# Set permissions to allow automatic updates
@ -35,7 +54,7 @@ MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vn
StartupNotify=true" > /usr/share/applications/firefox.desktop
# 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"
# Create a temporary directory for language packs
@ -59,5 +78,15 @@ mv ${tmp_dir}/*.xpi ${lang_pack_dir}
# Clean up the temporary directory
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

View File

@ -1,20 +1,39 @@
#!/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
# Supports both 32-bit and 64-bit architectures
# Set default locale to English (US) for initial Firefox download
default_locale="en-US"
# Function to download and install Firefox
install_firefox() {
local architecture="$1"
local default_locale="en-US"
# Determine the appropriate URL and file paths based on architecture
if [ "$architecture" == "32bit" ]; then
arch_url="linux"
lang_pack_arch="linux-i686"
else
arch_url="linux64"
lang_pack_arch="linux-x86_64"
fi
# URL to download the latest Firefox
firefox_url="https://download.mozilla.org/?product=firefox-latest&os=${arch_url}&lang=${default_locale}"
# Get the latest version number
firefox_version=$(curl -sL ${firefox_url} | grep -o 'firefox-[0-9.]*.tar.bz2' | sed 's/firefox-//g' | sed 's/.tar.bz2//g')
# Construct the filename for download
firefox_filename="firefox-${firefox_version}.tar.bz2"
# Download the latest version of Firefox
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')
firefox_filename="firefox-${firefox_version}.tar.bz2"
wget -O /tmp/${firefox_filename} "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${default_locale}"
wget -O /tmp/${firefox_filename} ${firefox_url}
# Extract and install Firefox
# Extract and install Firefox to /opt/firefox
tar -C /opt -xvf /tmp/${firefox_filename}
# Create a symbolic link for Firefox
# Create a symbolic link for Firefox in /usr/bin
ln -sf /opt/firefox/firefox /usr/bin/firefox
# Set permissions to allow automatic updates
@ -35,7 +54,7 @@ MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vn
StartupNotify=true" > /usr/share/applications/firefox.desktop
# 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"
# Create a temporary directory for language packs
@ -59,5 +78,15 @@ mv ${tmp_dir}/*.xpi ${lang_pack_dir}
# Clean up the temporary directory
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

View File

@ -1,20 +1,39 @@
#!/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
# Supports both 32-bit and 64-bit architectures
# Set default locale to English (US) for initial Firefox download
default_locale="en-US"
# Function to download and install Firefox
install_firefox() {
local architecture="$1"
local default_locale="en-US"
# Determine the appropriate URL and file paths based on architecture
if [ "$architecture" == "32bit" ]; then
arch_url="linux"
lang_pack_arch="linux-i686"
else
arch_url="linux64"
lang_pack_arch="linux-x86_64"
fi
# URL to download the latest Firefox
firefox_url="https://download.mozilla.org/?product=firefox-latest&os=${arch_url}&lang=${default_locale}"
# Get the latest version number
firefox_version=$(curl -sL ${firefox_url} | grep -o 'firefox-[0-9.]*.tar.bz2' | sed 's/firefox-//g' | sed 's/.tar.bz2//g')
# Construct the filename for download
firefox_filename="firefox-${firefox_version}.tar.bz2"
# Download the latest version of Firefox
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')
firefox_filename="firefox-${firefox_version}.tar.bz2"
wget -O /tmp/${firefox_filename} "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${default_locale}"
wget -O /tmp/${firefox_filename} ${firefox_url}
# Extract and install Firefox
# Extract and install Firefox to /opt/firefox
tar -C /opt -xvf /tmp/${firefox_filename}
# Create a symbolic link for Firefox
# Create a symbolic link for Firefox in /usr/bin
ln -sf /opt/firefox/firefox /usr/bin/firefox
# Set permissions to allow automatic updates
@ -35,7 +54,7 @@ MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vn
StartupNotify=true" > /usr/share/applications/firefox.desktop
# 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"
# Create a temporary directory for language packs
@ -59,5 +78,15 @@ mv ${tmp_dir}/*.xpi ${lang_pack_dir}
# Clean up the temporary directory
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

View File

@ -1,20 +1,39 @@
#!/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
# Supports both 32-bit and 64-bit architectures
# Set default locale to English (US) for initial Firefox download
default_locale="en-US"
# Function to download and install Firefox
install_firefox() {
local architecture="$1"
local default_locale="en-US"
# Determine the appropriate URL and file paths based on architecture
if [ "$architecture" == "32bit" ]; then
arch_url="linux"
lang_pack_arch="linux-i686"
else
arch_url="linux64"
lang_pack_arch="linux-x86_64"
fi
# URL to download the latest Firefox
firefox_url="https://download.mozilla.org/?product=firefox-latest&os=${arch_url}&lang=${default_locale}"
# Get the latest version number
firefox_version=$(curl -sL ${firefox_url} | grep -o 'firefox-[0-9.]*.tar.bz2' | sed 's/firefox-//g' | sed 's/.tar.bz2//g')
# Construct the filename for download
firefox_filename="firefox-${firefox_version}.tar.bz2"
# Download the latest version of Firefox
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')
firefox_filename="firefox-${firefox_version}.tar.bz2"
wget -O /tmp/${firefox_filename} "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=${default_locale}"
wget -O /tmp/${firefox_filename} ${firefox_url}
# Extract and install Firefox
# Extract and install Firefox to /opt/firefox
tar -C /opt -xvf /tmp/${firefox_filename}
# Create a symbolic link for Firefox
# Create a symbolic link for Firefox in /usr/bin
ln -sf /opt/firefox/firefox /usr/bin/firefox
# Set permissions to allow automatic updates
@ -35,7 +54,7 @@ MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vn
StartupNotify=true" > /usr/share/applications/firefox.desktop
# 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"
# Create a temporary directory for language packs
@ -59,5 +78,15 @@ mv ${tmp_dir}/*.xpi ${lang_pack_dir}
# Clean up the temporary directory
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