FlashUpdater

This section is designed for your 'porteus build scripts' which create Porteus modules for your favorite applications. Scripts should work like the well-known 'SlackBuilds' with minimum user interaction.
User avatar
Rava
Contributor
Contributor
Posts: 1319
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 3.1.0 x86-64 XFCe
Location: Germany

Re: FlashUpdater

Post#16 by Rava » 01 Nov 2013, 17:15

I tried, and moved the flashplayer to the usual place on a Linux system:
/usr/lib64/mozilla/plugins/libflashplayer.so

But the newest Firefox - Version 25.0, now tells me it has no plugins at all, and it lacks a flashplayer...
Did they change the place in the Linux hierarchy? Is it no longer to be put into /usr/lib64/mozilla/plugins/ ?

Darn Mozilla and documented changes! The lastest flashplayer I get by manual download, has the flashplayer in its root. The readme says:
o Identify the location of the browser plugins directory, based on your Linux distribution and Firefox version
o Copy libflashplayer.so to the appropriate browser plugins directory. At the prompt type:
+ cp libflashlayer.so <BrowserPluginsLocation>
And the " browser plugins directory, based on your Linux distribution and Firefox version" always was /usr/lib64/mozilla/plugins/ ...
Cheers!
Yours Rava

User avatar
Rava
Contributor
Contributor
Posts: 1319
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 3.1.0 x86-64 XFCe
Location: Germany

Re: FlashUpdater

Post#17 by Rava » 01 Nov 2013, 17:32

Update

Posted my issue on the Mozilla help forum: https://support.mozilla.org/en-US/questions/976075

Hopefully I get the answer that fixes the issue... I keep you updated...
Cheers!
Yours Rava

User avatar
Rava
Contributor
Contributor
Posts: 1319
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 3.1.0 x86-64 XFCe
Location: Germany

Re: FlashUpdater

Post#18 by Rava » 22 Jun 2014, 00:30

Some updates...

sadly, the older above pBuild (running on a x86_64 system, so the URL would be http://fpdownload.macromedia.com/get/fl ... _64.tar.gz ) no longer downloads the latest version.... It is still the version of 2012... O___o

When I make a direct download with the browser, then the used URL is this one:
http://fpdownload.macromedia.com/get/fl ... _64.tar.gz
That URL sure works OK with wget.

But changing it into this
http://fpdownload.macromedia.com/get/fl ... _64.tar.gz
and trying wget just gives an 404...

Any ideas how that could be solved?

My only idea is to somehow read the version number from the page http://get.adobe.com/flashplayer/ and insert the version number in the above URL, as in: changing the 11.2.202.378 part to the most recent version...
Cheers!
Yours Rava

User avatar
Ed_P
Contributor
Contributor
Posts: 3053
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

Re: FlashUpdater

Post#19 by Ed_P » 22 Jun 2014, 01:01

Rava wrote:My only idea is to somehow read the version number from the page http://get.adobe.com/flashplayer/ and insert the version number in the above URL, as in: changing the 11.2.202.378 part to the most recent version...
I've used that approach for an antivius update yrs ago. It should work for you.
Ed

tome
Contributor
Contributor
Posts: 561
Joined: 26 Jun 2013, 14:03
Distribution: x64 Openbox
Location: Poland
Contact:

Re: FlashUpdater

Post#20 by tome » 22 Jun 2014, 11:41

There is also bug at https://www.mozilla.org/en-US/plugincheck/ Firefox shows me that Shockwave Flash (Shockwave Flash 11.2 r202) is up to date but it isn't i.e.
Up to Date
11.2.202.341
and
Up to Date
11.2.202.378
are both up to date.

User avatar
Rava
Contributor
Contributor
Posts: 1319
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 3.1.0 x86-64 XFCe
Location: Germany

Re: FlashUpdater

Post#21 by Rava » 22 Jun 2014, 13:36

How can they be both up to date? O___o


Are both for x86 and x86_64?


At least now the old bug with the lib folder needed to be /usr/lib and not /usr/lib64 is now fixed... That was the one issue that let older Firefox (about 24 or 28 or such) not find the flash plugin, also it said on the Mozilla howto pages that it needed to be in /usr/lib64 when you run a x86_64 Linux...
Cheers!
Yours Rava

tome
Contributor
Contributor
Posts: 561
Joined: 26 Jun 2013, 14:03
Distribution: x64 Openbox
Location: Poland
Contact:

Re: FlashUpdater

Post#22 by tome » 26 Jul 2015, 16:06

If someone store flashplayer outside live filesystem (by symlink), use changes cheatcode or/and guest has write permissions to that directory, then the best and quickest way to update flashplayer could be this:

Code: Select all

#!/bin/bash
# @name flash_player_11-updater
# @authors Hamza & Rava & tome
# @version without module building

# Select right version to download
if [[ $(uname -m) == "x86_64" ]]; then ARCH="x86_64";LIB="64";else ARCH="i386";LIB="";fi
# LIB=""

# Define URL scheme
URL_SCHEME="https://fpdownload.macromedia.com/get/flashplayer/current/licensing/linux/install_flash_player_11_linux.$ARCH.tar.gz"

# Clean temp
[ -e "/tmp/flashplayer_latest" ] && rm -Rf "/tmp/flashplayer_latest"

# Go to proper directory
mkdir -p /tmp/flashplayer_latest
cd /tmp/flashplayer_latest

# Download latest flash player from Adobe
wget --no-check-certificate "https://fpdownload.macromedia.com/get/flashplayer/current/licensing/linux/install_flash_player_11_linux.$ARCH.tar.gz"

# Unpacking the libflashplayer.so plugin
if [ -f /tmp/flashplayer_latest/install_flash_player_11_linux.$ARCH.tar.gz ]; then
  tar --extract --file=./install_flash_player_11_linux.$ARCH.tar.gz libflashplayer.so
  dirname `realpath /usr/lib/*/plugins/libflash*` > /tmp/flashplayer_latest/flashpaths
  pd=`sed -n '1p' /tmp/flashplayer_latest/flashpaths`
  mv ./libflashplayer.so $pd

else

  # Extraction gave an error: give user a warning.
  echo "Warning! extraction failed. Look for more info above. Abort!"

  # exit with error
  exit 1
fi
firefox/opera-12 restart required

User avatar
Ed_P
Contributor
Contributor
Posts: 3053
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

Re: FlashUpdater

Post#23 by Ed_P » 27 Jul 2015, 03:02

I prefer a module approach but good to see an alternative to the broken USM system. Especially for something as important as browser security.
Ed

tome
Contributor
Contributor
Posts: 561
Joined: 26 Jun 2013, 14:03
Distribution: x64 Openbox
Location: Poland
Contact:

Re: FlashUpdater

Post#24 by tome » 17 Apr 2016, 21:10

Update, I have added version checking thanks to Blaze (and Geoffrey)

Code: Select all

#!/bin/bash
# @name flash_player_11-updater
# @authors Hamza, Rava, Geoffrey & tome
# version without module building
# last author: tome
# last changed: 2016-04-18

where() { which $1 2>/dev/null; }
suopen=`where ktsuss || where gksu || where kdesu || where gnsu`

if [[ "$UID" != "0" ]]; then
  $suopen "$0 $1"
  exit
fi

# Go to proper directory
mkdir -p /tmp/flashplayer_latest
cd /tmp/flashplayer_latest

# Find where is your libflashplayer, get and check only one version
realpath /usr/lib/*/plugins/libflash*.so > /tmp/flashplayer_latest/flashpaths 2>/dev/null
rp=`sed -n '1p' /tmp/flashplayer_latest/flashpaths`

# Installed version of flashplayer  
if [[ -e "$rp" ]]; then
pp=`dirname $rp`
iv=`awk '/LNX / {gsub(/\,/,".",$0);print substr($2,1,12)}' $rp`
fi

if [[ ! -e "$rp" ]]; then
mkdir -p /usr/lib/mozilla/plugins
pp=/usr/lib/mozilla/plugins
iv=none
fi

# Latest version of flashplayer available to download
# if "get.adobe.com/flashplayer/" could not be found from some locale's, get update version info from alternate url "adobe.com/software/flash/about" rg66

rm -f /tmp/flashplayer_latest/index.html
wget --no-check-certificate -O- --spider get.adobe.com/flashplayer/ > /tmp/flashplayer_latest/flash_url 2>&1 

if grep -q '200 OK' /tmp/flashplayer_latest/flash_url 2> /dev/null; then
wget --no-check-certificate --user-agent="Mozilla Linux" -q -N get.adobe.com/flashplayer/ -P /tmp/flashplayer_latest
lv=`sed -n '/<strong>Version /s/^.*<strong>Version \(.*\)<\/strong>.*$/\1/p' /tmp/flashplayer_latest/index.html`
else
wget -q -N adobe.com/software/flash/about/ -P /tmp/flashplayer_latest
lv=`cat /tmp/flashplayer_latest/index.html | grep -A2 Linux | grep [0-9] | awk -F '[><]' '{print $3}' | tr -d "\n"` #rg66
fi

if [[ $lv != 11.2.* ]]; then
echo ""
echo "[31mCheck your internet connection!
Check http://get.adobe.com/flashplayer[0m"
exit 0
fi

echo "
Installed flashplayer version: $iv  
Available flashplayer version: $lv"

if [[ $lv == $iv ]]; then
echo "Installed and available versions are the same.
[36mExiting...[0m"
exit 0
fi

echo "
Press [36mEnter[0m to install available flashplayer version, or Ctrl+C to abort..."
read junk

# Select right version to download
if [[ $(uname -m) == "x86_64" ]]; then ARCH="x86_64";LIB="64";else ARCH="i386";LIB="";fi
# LIB=""

# Define URL scheme
URL_SCHEME="https://fpdownload.macromedia.com/get/flashplayer/current/licensing/linux/install_flash_player_11_linux.$ARCH.tar.gz"

# Download latest flash player from Adobe
wget --no-check-certificate -c "https://fpdownload.macromedia.com/get/flashplayer/current/licensing/linux/install_flash_player_11_linux.$ARCH.tar.gz"

# Unpacking the libflashplayer.so plugin
if [ -f /tmp/flashplayer_latest/install_flash_player_11_linux.$ARCH.tar.gz ]; then
  tar --extract --file=./install_flash_player_11_linux.$ARCH.tar.gz libflashplayer.so
  mv ./libflashplayer.so $pp

else

  # Extraction gave an error: give user a warning.
  echo "Warning! extraction failed. Look for more info above. Abort!"

  # exit with error
  exit 1
fi

# Clean temp
[ -e "/tmp/flashplayer_latest" ] && rm -Rf "/tmp/flashplayer_latest"

User avatar
Rava
Contributor
Contributor
Posts: 1319
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 3.1.0 x86-64 XFCe
Location: Germany

Re: FlashUpdater

Post#25 by Rava » 17 Apr 2016, 21:17

Won't work for me:

Code: Select all

rava@porteus:/mnt/DL$ ./flashupdate.pBuild 

Check your internet connection!
Check http://get.adobe.com/flashplayer
rava@porteus:/mnt/DL$ ipcheck 
2016.04.17 23:14:21 IP: [here.my.current.IP] wget: 0
So, my ipcheck script verifies that I have a working internet connection by getting my external IP address via a remote webpage.


Also, I think this

Code: Select all

mkdir -p /usr/lib/mozilla/plugins
will fail if started by standard non-root user (as I did.)

Also, you not check if the user running the script is root.

And the script should be able to at least get all needed files for the update when srun my a non root user, and then tell the user what root needs to do to put them where they belong in the file system, or better: give instructions how to create a latest-flash module.
Cheers!
Yours Rava

tome
Contributor
Contributor
Posts: 561
Joined: 26 Jun 2013, 14:03
Distribution: x64 Openbox
Location: Poland
Contact:

Re: FlashUpdater

Post#26 by tome » 17 Apr 2016, 21:37

Of course, Rava, pbuild scripts should be executed by root, or switched to root :wink:

User avatar
Rava
Contributor
Contributor
Posts: 1319
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 3.1.0 x86-64 XFCe
Location: Germany

Re: FlashUpdater

Post#27 by Rava » 17 Apr 2016, 22:27

tome wrote:Of course, Rava, pbuild scripts should be executed by root, or switched to root :wink:
Then the script should check if $UID=0 if not, ask for root password.

And here is the result when run as root:

Code: Select all

root@porteus:/mnt/DL# ./flashupdate.pBuild 

Check your internet connection!
Check http://get.adobe.com/flashplayer
Do you see a pattern here?
Cheers!
Yours Rava

tome
Contributor
Contributor
Posts: 561
Joined: 26 Jun 2013, 14:03
Distribution: x64 Openbox
Location: Poland
Contact:

Re: FlashUpdater

Post#28 by tome » 18 Apr 2016, 06:57

Haha :lol: Yes, I think I see it. Thanks for tip. But now every porteus script should be rewritten? :unknown:

Is it correct?

Code: Select all

where() { which $1 2>/dev/null; }
suopen=`where ktsuss || where gksu || where kdesu || where gnsu`

if [[ "$UID" != "0" ]]; then
  $suopen "$0 $1"
  exit
fi
Feel free to edit and share improved code. :good:

User avatar
Rava
Contributor
Contributor
Posts: 1319
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 3.1.0 x86-64 XFCe
Location: Germany

Re: FlashUpdater

Post#29 by Rava » 18 Apr 2016, 08:48

You for got to address the main issue of my post: Even when started as root your pBuild still fails with the same errors!
____________________________________________________________________
tome wrote:Haha :lol: Yes, I think I see it. Thanks for tip. But now every porteus script should be rewritten? :unknown:
Yes, it only needs a small code snippet at the start.
We can also propose a hard linked address for a script that has the code that does that checking and also the needed su, like

Code: Select all

. /opt/porteus-scripts/pBuild.rootcheck
Then every pBuild only needs to add only that one line at the beginning of the code, and the rest is done by the included /opt/porteus-scripts/pBuild.rootcheck code.

This code can be used for any scripts, other Porteus scripts who need root privileges, all pBuild scripts, and every user script that also needs root can use that line as well.
Sounds like a neat solution for me. :D
Cheers!
Yours Rava

tome
Contributor
Contributor
Posts: 561
Joined: 26 Jun 2013, 14:03
Distribution: x64 Openbox
Location: Poland
Contact:

Re: FlashUpdater

Post#30 by tome » 18 Apr 2016, 09:42

You forgot to address the main issue of my post: Even when started as root your pBuild still fails with the same errors!
Sorry for that, I have made little correction, maybe now it works. If there is still something wrong in script, please delete my and your last unneeded posts, I give up :(

Post Reply