Code: Select all
#!/bin/bash
# @name FlashUpdater
# @authors Rava & Hamza
# @version 2.0
# Select right version to download
if [[ $(uname -m) == "x86_64" ]]; then ARCH="x86_64";LIB="64";else ARCH="i386";LIB="";fi
# Define URL scheme
URL_SCHEME="http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_11_linux.$ARCH.tar.gz"
# Clean temp
[ -e "/tmp/flashplayer_latest" ] && rm -Rf "/tmp/flashplayer_latest"
# Make module structure
mkdir -p /tmp/flashplayer_latest/usr/lib$LIB/{mozilla,opera}/plugins
mkdir -p /tmp/flashplayer_latest/opt/google/chromium/plugins
# Download latest flash player from Adobe
wget --progress=bar:force -O "/tmp/flashplayer_latest/flashplayer.$$.tar.gz" $URL_SCHEME
# Unpacking the flashplayer archive
if [ -f /tmp/flashplayer_latest/flashplayer.$$.tar.gz ]; then
gunzip /tmp/flashplayer_latest/flashplayer.$$.tar.gz
cd /tmp/flashplayer_latest
tar -xvf /tmp/flashplayer_latest/flashplayer.$$.tar
cp -p /tmp/flashplayer_latest/libflashplayer.so /tmp/flashplayer_latest/usr/lib$LIB/mozilla/plugins
cd /tmp/flashplayer_latest/usr/lib$LIB/opera/plugins
ln -sf ../../mozilla/plugins/libflashplayer.so libflashplayer.so
cd /tmp/flashplayer_latest/opt/google/chromium/plugins
ln -sf /usr/lib$LIB/mozilla/plugins/libflashplayer.so libflashplayer.so
rm /tmp/flashplayer_latest/{readme.txt,libflashplayer.so}
rm /tmp/flashplayer_latest/flashplayer.$$.tar
# using the timestamp of the flashplayer as "version" part of the filename.
VERS=$(stat -c %y /tmp/flashplayer_latest/usr/lib$LIB/mozilla/plugins/libflashplayer.so|cut -b 1-10)
# Making of the final module if extraction was successful
dir2xzm "/tmp/flashplayer_latest" "/tmp/flashplayer_${ARCH}_${VERS}.xzm"
# Clean the system
rm -Rf /tmp/flashplayer_latest
else
# Extraction gave an error: give user a warning.
echo "Warning! extraction failed. Look for more info above. Abort!"
# Clean the system
rm -Rf /tmp/flashplayer_latest
# exit with error
exit 1
fi
Supported browsers:
- Mozilla Firefox
- Opera
- Chromium
Enjoy!