Firefox always up to date (autd) - i686 & x86_64
Posted: 22 Mar 2015, 21:52
This script allows you to to have always up to date Firefox. Now Firefox can check for updates and download them in the background without any need of action.
If you set that only root can update Firefox then:
1. Close current Firefox instance and run Firefox as root from terminal (firefox-autd)
2. Choose from menu: Help->About Firefox
3. Firefox will download updates.
Run this script as root and set your parameters at first section (1. Beginning of settings you should set) of this script
Old code 1:
Todo for next script editing:
echo " realpath to firefox dir "$realpath/apps
ln -s /usr/lib64/mozilla/plugins/*.so /usr/lib/mozilla/plugins
EDIT:
Little changes, thanks Ed_P
Update, thanks tb01 for your additions and spent time
If you set that only root can update Firefox then:
1. Close current Firefox instance and run Firefox as root from terminal (firefox-autd)
2. Choose from menu: Help->About Firefox
3. Firefox will download updates.
Run this script as root and set your parameters at first section (1. Beginning of settings you should set) of this script
Code: Select all
#!/bin/bash
# Firefox always up to date
# Script by tome
# 1. User preferences 2. Paths 3. Download/extract 4. Launcher+icon module
# Run as root
if [ `whoami` != "root" ]; then
ktsuss "$0 $1"
exit
fi
# 1. Beginning of settings you should set
# Directory where you want to store data on your booting device
mirror=data-mirror
# Change your architecture if needed, i686, x86_64 or `uname -m` (current)
myarch=`uname -m`
# Localized version (language) choose one from: ach af an ar as ast az be bg bn-BD bn-IN br bs ca cs cy da de dsb el en-GB en-US en-ZA eo es-AR es-CL es-ES es-MX et eu fa ff fi fr fy-NL ga-IE gd gl gu-IN he hi-IN hr hsb hu hy-AM id is it ja kk km kn ko lij lt lv mai mk ml mr ms nb-NO nl nn-NO or pa-IN pl pt-BR pt-PT rm ro ru si sk sl son sq sr sv-SE ta te th tr uk vi xh xpi zh-CN zh-TW
lang=en-GB
# Who can update, choose root, guest or your user name, it doesn't matter for ntfs/fat filesystems
me=guest
# Where you want to place created firefox-links.xzm module, change path if you boot from iso
where=/mnt/live/porteus/modules
# End of settings you should set
echo
echo Settings:
echo " mirror "$mirror
echo " myarch "$myarch
echo " lang "$lang
echo " me "$me
echo " where "$where
echo
# 2. Get booting device
bdev=`grep -A1 "Booting" /var/log/porteus-livedbg|tail -n1|sed 's^//^/^g'`
realpath=${bdev}/$mirror
mkdir -p $realpath/apps
# 3. Download/extract
cd /tmp
wget -c http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest/linux-$myarch/$lang/ /tmp
if [ ! -e "/tmp/index.html" ]; then echo ""
echo "[31mCheck your internet connection! Exiting.[0m"
exit 0
fi
latest_version=`grep tar.bz2 index.html | tail -n1 | cut -d- -f2- | cut -d '"' -f1 | cut -d '/' -f3`
#old latest_version=`grep tar.bz2 index.html | head -n1 | cut -d- -f2- | cut -d '"' -f1`
echo "Downloading latest version of Mozilla Firefox"
wget -c https://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest/linux-$myarch/$lang/$latest_version
# or wget --no-check-certificate -c http...
if [ -e "/tmp/$latest_version" ]; then echo "Extracting $latest_version"
tar xjvf $latest_version -C $realpath/apps
else
clear
echo ""
echo "[36mCheck your internet connection! Exiting.[0m"
exit 0
fi
# 4. Preparing module
rm -rf /tmp/firefox-autd
if [ -e /mnt/live/memory/images/firefox-links.xzm ]; then deactivate /mnt/live/memory/images/firefox-links.xzm
echo Deactivating old firefox-links.xzm module
fi
umount $where/firefox-links.xzm
rm -rf $where/firefox-links.xzm
mkdir -p /tmp/firefox-autd/usr/bin
mkdir -p /tmp/firefox-autd/usr/share/applications
mkdir -p /tmp/firefox-autd/usr/share/icons/hicolor/48x48/apps
cp $realpath/apps/firefox/browser/chrome/icons/default/default48.png /tmp/firefox-autd/usr/share/icons/hicolor/48x48/apps/firefox.png
echo '#!/bin/sh' >> /tmp/firefox-autd/usr/bin/firefox-autd
echo 'bdev=`grep -A1 "Booting" /var/log/porteus-livedbg|tail -n1|sed 's^//^/^g'`' >> /tmp/firefox-autd/usr/bin/firefox-autd
echo 'exec ${bdev}/'$mirror'/apps/firefox/firefox "$@"' >> /tmp/firefox-autd/usr/bin/firefox-autd
chmod 755 /tmp/firefox-autd/usr/bin/firefox-autd
chown $me:$me $realpath/apps/firefox
echo "Generating Desktop Files..."
#Creating mozilla-firefox-autd-p.desktop
echo '[Desktop Entry]' >> /tmp/firefox-autd/usr/share/applications/mozilla-firefox-autd-p.desktop
echo 'Exec=firefox-autd -no-remote -p %u' >> /tmp/firefox-autd/usr/share/applications/mozilla-firefox-autd-p.desktop
echo 'Icon=firefox' >> /tmp/firefox-autd/usr/share/applications/mozilla-firefox-autd-p.desktop
echo 'Type=Application' >> /tmp/firefox-autd/usr/share/applications/mozilla-firefox-autd-p.desktop
echo 'Categories=Network;' >> /tmp/firefox-autd/usr/share/applications/mozilla-firefox-autd-p.desktop
echo 'Name=Firefox Profile Manager' >> /tmp/firefox-autd/usr/share/applications/mozilla-firefox-autd-p.desktop
echo 'MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;' >> /tmp/firefox-autd/usr/share/applications/mozilla-firefox-autd-p.desktop
echo 'X-KDE-StartupNotify=true' >> /tmp/firefox-autd/usr/share/applications/mozilla-firefox-autd-p.desktop
#Creating mozilla-firefox-autd.desktop
echo '[Desktop Entry]' >> /tmp/firefox-autd/usr/share/applications/mozilla-firefox-autd.desktop
echo 'Exec=firefox-autd %u' >> /tmp/firefox-autd/usr/share/applications/mozilla-firefox-autd.desktop
echo 'Icon=firefox' >> /tmp/firefox-autd/usr/share/applications/mozilla-firefox-autd.desktop
echo 'Type=Application' >> /tmp/firefox-autd/usr/share/applications/mozilla-firefox-autd.desktop
echo 'Categories=Network;' >> /tmp/firefox-autd/usr/share/applications/mozilla-firefox-autd.desktop
echo 'Name=Firefox' >> /tmp/firefox-autd/usr/share/applications/mozilla-firefox-autd.desktop
echo 'MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;' >> /tmp/firefox-autd/usr/share/applications/mozilla-firefox-autd.desktop
echo 'X-KDE-StartupNotify=true' >> /tmp/firefox-autd/usr/share/applications/mozilla-firefox-autd.desktop
echo "Building the module."
mkdir -p $where
mksquashfs /tmp/firefox-autd $where/firefox-links.xzm -b 256K
#clear
echo -e "\n\n"
echo "DONE"
echo "Activating of $where/firefox-links.xzm"
echo ""
activate $where/firefox-links.xzm
exit 0
Code: Select all
#!/bin/bash
# Firefox always up to date
# Script by tome
# Run as root
# 1. User preferences 2. Paths 3. Download/extract 4. Launcher+icon module
# 1. Beginning of settings you should set
# Directory where you want to store data on your booting device
mirror=data-mirror
# Choose your architecture i686 or x86_64 (eventually `uname -m`, if you have new hardware)
myarch=`uname -m`
# Localized version (language) choose one from: ach af an ar as ast az be bg bn-BD bn-IN br bs ca cs cy da de dsb el en-GB en-US en-ZA eo es-AR es-CL es-ES es-MX et eu fa ff fi fr fy-NL ga-IE gd gl gu-IN he hi-IN hr hsb hu hy-AM id is it ja kk km kn ko lij lt lv mai mk ml mr ms nb-NO nl nn-NO or pa-IN pl pt-BR pt-PT rm ro ru si sk sl son sq sr sv-SE ta te th tr uk vi xh xpi zh-CN zh-TW
lang=en-GB
# Who can update, choose root, guest or your user name, it doesn't matter for ntfs/fat filesystems
me=guest
# Where you want to place created firefox-links.xzm module
where=/mnt/live/porteus/modules
# End of settings you should set
# 2. Get booting device
bdev=`grep -A1 "Booting" /var/log/porteus-livedbg|tail -n1|sed 's^//^/^g'`
realpath=${bdev}/$mirror
mkdir -p $realpath/apps
# 3. Download/extract
cd /tmp
wget -c http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest/linux-$myarch/$lang/ /tmp
if [ ! -e "/tmp/index.html" ]; then echo ""
echo "[31mCheck your internet connection! Exiting.[0m"
exit 0
fi
latest_version=`grep tar.bz2 index.html | head -n1 | cut -d- -f2- | cut -d '"' -f1`
echo "Downloading latest version of Mozilla Firefox"
wget -c http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest/linux-$myarch/$lang/firefox-$latest_version
if [ -e "/tmp/firefox-$latest_version" ]; then echo "Extracting firefox-$latest_version"
tar xjvf firefox-$latest_version -C $realpath/apps
else
clear
echo ""
echo "[36mCheck your internet connection! Exiting.[0m"
exit 0
fi
# 4. Preparing module
rm -rf /tmp/firefox-autd
if [ -e /mnt/live/memory/images/firefox-links.xzm ]; then deactivate /mnt/live/memory/images/firefox-links.xzm
echo Deactivating old firefox-links.xzm module
fi
umount $where/firefox-links.xzm
rm -rf $where/firefox-links.xzm
mkdir -p /tmp/firefox-autd/usr/bin
mkdir -p /tmp/firefox-autd/usr/share/applications
mkdir -p /tmp/firefox-autd/usr/share/icons/hicolor/48x48/apps
cp $realpath/apps/firefox/browser/chrome/icons/default/default48.png /tmp/firefox-autd/usr/share/icons/hicolor/48x48/apps/firefox.png
echo '#!/bin/sh' >> /tmp/firefox-autd/usr/bin/firefox-autd
echo 'bdev=`grep -A1 "Booting" /var/log/porteus-livedbg|tail -n1|sed 's^//^/^g'`' >> /tmp/firefox-autd/usr/bin/firefox-autd
echo 'exec ${bdev}/'$mirror'/apps/firefox/firefox "$@"' >> /tmp/firefox-autd/usr/bin/firefox-autd
chmod 755 /tmp/firefox-autd/usr/bin/firefox-autd
chown $me:$me $realpath/apps/firefox
echo "Generating Desktop Files..."
#Creating mozilla-firefox-autd-p.desktop
echo '[Desktop Entry]' >> /tmp/firefox-autd/usr/share/applications/mozilla-firefox-autd-p.desktop
echo 'Exec=firefox-autd -no-remote -p %u' >> /tmp/firefox-autd/usr/share/applications/mozilla-firefox-autd-p.desktop
echo 'Icon=firefox' >> /tmp/firefox-autd/usr/share/applications/mozilla-firefox-autd-p.desktop
echo 'Type=Application' >> /tmp/firefox-autd/usr/share/applications/mozilla-firefox-autd-p.desktop
echo 'Categories=Network;' >> /tmp/firefox-autd/usr/share/applications/mozilla-firefox-autd-p.desktop
echo 'Name=Firefox Profile Manager' >> /tmp/firefox-autd/usr/share/applications/mozilla-firefox-autd-p.desktop
echo 'MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;' >> /tmp/firefox-autd/usr/share/applications/mozilla-firefox-autd-p.desktop
echo 'X-KDE-StartupNotify=true' >> /tmp/firefox-autd/usr/share/applications/mozilla-firefox-autd-p.desktop
#Creating mozilla-firefox-autd.desktop
echo '[Desktop Entry]' >> /tmp/firefox-autd/usr/share/applications/mozilla-firefox-autd.desktop
echo 'Exec=firefox-autd %u' >> /tmp/firefox-autd/usr/share/applications/mozilla-firefox-autd.desktop
echo 'Icon=firefox' >> /tmp/firefox-autd/usr/share/applications/mozilla-firefox-autd.desktop
echo 'Type=Application' >> /tmp/firefox-autd/usr/share/applications/mozilla-firefox-autd.desktop
echo 'Categories=Network;' >> /tmp/firefox-autd/usr/share/applications/mozilla-firefox-autd.desktop
echo 'Name=Firefox' >> /tmp/firefox-autd/usr/share/applications/mozilla-firefox-autd.desktop
echo 'MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;' >> /tmp/firefox-autd/usr/share/applications/mozilla-firefox-autd.desktop
echo 'X-KDE-StartupNotify=true' >> /tmp/firefox-autd/usr/share/applications/mozilla-firefox-autd.desktop
echo "Building the module."
mksquashfs /tmp/firefox-autd $where/firefox-links.xzm -b 256K
clear
echo "DONE"
echo "Activating of $where/firefox-links.xzm"
echo ""
activate $where/firefox-links.xzm
exit 0
echo " realpath to firefox dir "$realpath/apps
ln -s /usr/lib64/mozilla/plugins/*.so /usr/lib/mozilla/plugins
EDIT:
Little changes, thanks Ed_P
Update, thanks tb01 for your additions and spent time