#!/bin/bash
#
# Install Flash 10.2 "Square" into the proper folder in Ubuntu 64 bit
# This process has only been tested on Lucid Lynx 64 bit.

script_name="install_flash_10.2_square.sh"

# Script must run as root 
if [ $USER != "root" ]; then
	echo "You need to run this script as root."
	echo "Use 'sudo ./$script_name' then enter your password when prompted."
	exit 1
fi

# uninstall the 32 bit flashplugin
sudo apt-get -y autoremove flashplugin-nonfree

# change to the users home folder
cd ~

# download the .tar.gz archive that contains the plugin
wget http://www.stchman.com/tools/Flash_10_64bit/flashplayer10_2_p3_64bit_linux_111710.tar.gz

# delete all traces of the flash plugin in the users home directory and 
sudo rm -f ~/.mozilla/plugins/libflas*.so
sudo rm -f /usr/lib/firefox-addons/plugins/libflas*.so

# unpack the plugin into the /usr/lib/firefox-addons/plugins/ folder
sudo tar -C /usr/lib/firefox-addons/plugins/ -vxzf ./flashplayer10_2_p3_64bit_linux_111710.tar.gz

# remove the archive as it is no longer needed
sudo rm -f ~/flashplayer10_2_p3_64bit_linux_111710.tar.gz
