wok rev 1684

get-flash-plugin: may select version
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Nov 08 17:55:54 2008 +0000 (2008-11-08)
parents 9866a672f23f
children 84614d77f18a
files get-flash-plugin/stuff/get-flash-plugin
line diff
     1.1 --- a/get-flash-plugin/stuff/get-flash-plugin	Sat Nov 08 14:20:26 2008 +0000
     1.2 +++ b/get-flash-plugin/stuff/get-flash-plugin	Sat Nov 08 17:55:54 2008 +0000
     1.3 @@ -1,4 +1,5 @@
     1.4  #!/bin/sh -e
     1.5 +: ${DIALOG=tazdialog}
     1.6  
     1.7  if test $(id -u) != 0 ; then
     1.8  	echo -e "\nYou must be root to run `basename $0`."
     1.9 @@ -10,12 +11,32 @@
    1.10    tazpkg remove flash-plugin
    1.11    [ -d /var/lib/tazpkg/installed/flash-plugin ] && exit 1
    1.12  fi
    1.13 -DIR=install_flash_player_9_linux
    1.14 -TARBALL=$DIR.tar.gz
    1.15  WEB_SITE="http://www.adobe.com/products/flash/"
    1.16 +URL="http://fpdownload.macromedia.com/get/flashplayer/current/"
    1.17  
    1.18  # Download tarball
    1.19 -wget http://fpdownload.macromedia.com/get/flashplayer/current/$TARBALL
    1.20 +VERSIONS=""
    1.21 +for i in $(seq 20 -1 7); do
    1.22 +  wget -s ${URL}install_flash_player_${i}_linux.tar.gz 2> /dev/null || continue
    1.23 +  VERSIONS="$VERSIONS $i"
    1.24 +done
    1.25 +
    1.26 +value="$(echo $VERSIONS)"
    1.27 +case "$VERSIONS" in
    1.28 +*[0-9]\ [1-9]*)
    1.29 +	exec 3>&1
    1.30 +	value=`$DIALOG --clear --colors --title " Install Flash plugin " \
    1.31 +		--menu  "Which version to install" 16 70 5 \
    1.32 +		$(for i in $VERSIONS; do echo $i; echo "flash-$i"; done) \
    1.33 +		2>&1 1>&3`
    1.34 +	retval=$?
    1.35 +	exec 3>&-
    1.36 +	[ -n "$value" ] || exit 0
    1.37 +	[ "$retval" = "1" ] && exit 0
    1.38 +esac
    1.39 +DIR=install_flash_player_${value}_linux
    1.40 +TARBALL=$DIR.tar.gz
    1.41 +wget $URL$TARBALL
    1.42  
    1.43  # Extract
    1.44  tar xzf $TARBALL