Last active
July 4, 2016 20:24
-
-
Save approximatenumber/2ea711eba2dfd86a490b85ae067592ea to your computer and use it in GitHub Desktop.
Download a new version of flashplayer and move it in mozilla dir.
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
#!/bin/bash | |
set -a | |
player="libflashplayer.so" | |
work_dir="/tmp/flash_update" | |
mozilla_dir="$HOME/.mozilla/plugins" | |
download_player() { | |
tarball="install_flash_player_11_linux.x86_64.tar.gz" | |
wget -nc "https://fpdownload.macromedia.com/get/flashplayer/current/licensing/linux/$tarball" | |
tar -xzf $tarball | |
} | |
get_cksum() { | |
cksum $1 | cut -d " " -f1 | |
} | |
mkdir -p $work_dir | |
cd $work_dir | |
download_player | |
new_player=$player | |
new_player_cksum=`get_cksum $new_player` | |
old_player="$mozilla_dir/$player" | |
if [ -f $old_player ]; then | |
old_player_cksum=`get_cksum $old_player` | |
else | |
old_player_cksum="0" | |
fi | |
if [ $old_player_cksum -eq $new_player_cksum ]; then | |
echo "Sums are the same, so nothing to update" | |
cd ../ | |
rm -fr $work_dir | |
else | |
mkdir -p "$mozilla_dir" | |
cp "$new_player" "$old_player" | |
echo "$player updated" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment