Last active
April 14, 2020 15:08
-
-
Save HorlogeSkynet/ca31d730607b558400ed96a1ba30494d to your computer and use it in GitHub Desktop.
A simple BASH script for automatically run manual Flash Player update on Linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# @Author: HorlogeSkynet | |
# @Created: 2017-05-21 | |
# @Updated: 2020-04-14 | |
# @Brief: A simple BASH script for automatically update Flash Player on Linux | |
# From <https://wiki.debian.org/FlashPlayer#Manual_update>. | |
# MUST be run as root. | |
FP_STATUS=$(update-flashplugin-nonfree --status | grep "Flash Player version ") | |
VERSION_INSTALLED=$(echo "${FP_STATUS}" | grep "installed" | cut -d ':' -f 2 | tr -d " ") | |
VERSION_AVAILABLE=$(echo "${FP_STATUS}" | grep "available" | cut -d ':' -f 2 | tr -d " ") | |
if [[ "${VERSION_INSTALLED}" == "${VERSION_AVAILABLE}" ]]; then | |
echo "Flash Player is already up-to-date. (${VERSION_INSTALLED})" | |
exit | |
fi | |
echo -e "Flash Player is being manually updated...\\n" | |
wget -q \ | |
-O archive.tar.gz \ | |
--show-progress \ | |
"https://fpdownload.adobe.com/get/flashplayer/pdc/${VERSION_AVAILABLE}/flash_player_npapi_linux.x86_64.tar.gz" | |
tar -xzf archive.tar.gz libflashplayer.so | |
mv libflashplayer.so /usr/lib/flashplugin-nonfree/ | |
chmod 644 /usr/lib/flashplugin-nonfree/libflashplayer.so | |
chown root:root /usr/lib/flashplugin-nonfree/libflashplayer.so | |
rm archive.tar.gz | |
if [[ "$(update-alternatives --list flash-mozilla.so)" != "/usr/lib/flashplugin-nonfree/libflashplayer.so" ]]; then | |
update-alternatives \ | |
--quiet \ | |
--install \ | |
/usr/lib/mozilla/plugins/flash-mozilla.so \ | |
flash-mozilla.so \ | |
/usr/lib/flashplugin-nonfree/libflashplayer.so \ | |
50 | |
fi | |
echo "Flash Player has just been updated. (${VERSION_AVAILABLE})" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment