Commit 77427aa2 authored by kyodev's avatar kyodev

release 4.14.1

parent e2d9410d
......@@ -7,6 +7,12 @@ date au format: YYYY-MM-DD
## [ Unreleased ]
## [ 4.14.1 ] - 2018.06.13
* rewriting: f__archive_test, fflash_get_version
* rewriting: suppression sed peu utiles
* cosmetic: exit sur --help
## [ 4.14.0 ] - 2018.06.12
* syncro: composants, fscript_update avec ses parametres d'appel
......
# getFlashPlayer
![version: 4.14.O](https://img.shields.io/badge/version-4.14.O-blue.svg?longCache=true&style=for-the-badge)
![version: 4.14.1](https://img.shields.io/badge/version-4.14.1-blue.svg?longCache=true&style=for-the-badge)
![bash langage](https://img.shields.io/badge/bash-4-brightgreen.svg?longCache=true&style=for-the-badge)
![license LPRAB / WTFPL](https://img.shields.io/badge/license-LPRAB%20%2F%20WTFPL-blue.svg?longCache=true&style=for-the-badge)
......
#!/bin/bash
version=4.14.O
date="12/06/2018"
version=4.14.1
date="13/06/2018"
script="getFlashPlayer"
# contact="IRC ##sdeb@freenode.net ou https://framagit.org/sdeb/getFlashPlayer/issues"
......@@ -31,15 +31,20 @@ f__architecture(){ # 11/06/2018 SPECIFIQUE
}
# test validité archive, $1 archive, assigne $archive_detect (gzip|xz|deb|zip), return 1 si inconnue
f__archive_test(){ # O9/03/2018
local filetest
f__archive_test(){ # 13/06/2018
local filetest test
filetest=$( file -b "$1" )
grep -q 'gzip compressed data' <<< "$filetest" && archive_detect="gzip"
grep -q 'bzip2 compressed data' <<< "$filetest" && archive_detect="bzip2"
grep -q 'Debian binary package' <<< "$filetest" && archive_detect="deb"
grep -q 'Zip archive data' <<< "$filetest" && archive_detect="zip"
grep -q 'XZ compressed data' <<< "$filetest" && archive_detect="xz"
test=${filetest/*gzip compressed data*/1234567890}
[ "$test" == "1234567890" ] && archive_detect="gzip"
test=${filetest/*bzip2 compressed data*/1234567890}
[ "$test" == "1234567890" ] && archive_detect="bzip2"
test=${filetest/*binary compressed data*/1234567890}
[ "$test" == "1234567890" ] && archive_detect="deb"
test=${filetest/*Zip compressed data*/1234567890}
[ "$test" == "1234567890" ] && archive_detect="Zip"
test=${filetest/*XZ compressed data*/1234567890}
[ "$test" == "1234567890" ] && archive_detect="XZ"
if [[ -z "$archive_detect" || "$archive_detect" == "empty" ]]; then return 1; fi
}
......@@ -318,7 +323,7 @@ f_help(){ # 11/06/2018
end
}
fflash_avertissement(){ # 11/06/2018
fflash_avertissement(){ # 13/06/2018
cat <<- end
FlashPlayer n'est pas libre, c'est un programme propriétaire dont on ne peut pas connaître
......@@ -332,23 +337,33 @@ fflash_avertissement(){ # 11/06/2018
}
# version Flash en ligne & installée, si $1="quiet" pas d'affichage, assigne $ver_flash, $plugin_a_jour=ko
fflash_get_version(){ # 24/01/2018
fflash_get_version(){ # 13/06/2018
local verInstall
x_get_version=1
# détection version en ligne
ver_flash=$( wget -q --tries=2 --timeout=15 --user-agent="$user_agent" -o /dev/null -O - "$url_online" | \
sed -nr 's/^.*AUTO_ID.*Version[[:blank:]]+([0-9].*[0-9]).*$/\1/p' )
ver_flash=$( wget -q --tries=2 --timeout=15 --user-agent="$user_agent" -o /dev/null -O - "$url_online" )
if [[ "$ver_flash" =~ \<strong\>Version\ ([0-9.]+)\</strong\> ]]; then
ver_flash=${BASH_REMATCH[1]}
fi
# détection version installée
if [ -e "$dir_install/libflashplayer.so" ]; then
verInstall=$( strings "$dir_install"/libflashplayer.so | grep -Eo '[0-9]+_[0-9]+_[0-9]+_[0-9]+' | sed 's/_/./g' )
[[ "$ver_flash" && "$verInstall" == "$ver_flash" ]] || plugin_a_jour="ko"
else
verInstall="Non Installé"
verInstall=$( strings "$dir_install"/libflashplayer.so )
while read -r; do
if [[ "$REPLY" =~ ([0-9]+_[0-9]+_[0-9]+_[0-9]+) ]]; then
verInstall=${BASH_REMATCH[1]//_/.}
break
fi
done <<< "$verInstall"
if [[ "$ver_flash" && "$verInstall" && "$verInstall" != "$ver_flash" ]]; then
plugin_a_jour="ko"
fi
fi
[ "$ver_flash" ] || ver_flash="${RED}n/a"
[ "$1" == "quiet" ] && return 0
verInstall=${verInstall:="Non installé"}
ver_flash=${ver_flash:="${RED}n/a$STD"}
f__info "raw" "FlashPlayer en place: $GREEN$verInstall$STD"
f__info "FlashPlayer en ligne: $YELLOW$ver_flash$STD"
}
......@@ -714,7 +729,8 @@ for i in "${!options[@]}"; do # deuxième passe options, actions
fscript_get_version ;;
-h | --help | * ) # affichage help
f_help
fflash_avertissement ;;
fflash_avertissement
exit ;;
esac
done
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment