supp pour renommage

This commit is contained in:
kyodev 2017-06-05 09:48:41 +02:00
parent aafc03b31f
commit 313a5a41f8
1 changed files with 0 additions and 136 deletions

View File

@ -1,136 +0,0 @@
#!/bin/bash
ver="alpha0.3.2"
#####
# licence LPRAB/WTFPL
# auteurs naguam / kyodev
# 06/2017
#####
# entete ---------------------------------------------------------------
#clear
cat << "EOF"
_ _____ _ _ ____ _
__ _ ___| |_| ___| | __ _ ___| |__ | _ \| | __ _ _ _ ___ _ __
/ _` |/ _ \ __| |_ | |/ _` / __| '_ \| |_) | |/ _` | | | |/ _ \ '__|
| (_| | __/ |_| _| | | (_| \__ \ | | | __/| | (_| | |_| | __/ |
\__, |\___|\__|_| |_|\__,_|___/_| |_|_| |_|\__,_|\__, |\___|_|
|___/ |___/
EOF
echo -e "\t\t version $ver\n"
# arguments-------------------------------------------------------------
if [ "$1" == "install" ]; then cmd="install"
elif [ "$1" == "remove" ]; then cmd="remove"
else
# pas d'arguments ou mauvais -> help
echo "Utilisation : en mode administrateur (root)"
echo "./getFlashPlayer.sh install -> téléchargement et installation FlashPlayer"
echo "./getFlashPlayer.sh remove -> désinstallation FlashPlayer"
echo -e "\n\n"
exit 1
fi
# requis ---------------------------------------------------------------
# debian?
if [ -f /etc/debian_version ]; then
echo "Vous utilisez debian, vous pouvez lancer le script"
else
echo "Vous n'utilisez pas debian, adieu o/"
exit 1
fi
# root?
if [ ! $EUID -eq 0 ]; then
echo "vous n'êtes pas root, recommencez avec su ou sudo"
exit 1
fi
# fonction remove ------------------------------------------------------
f_remove() {
echo "à faire"
exit 0
}
if [ "$cmd" == "remove" ]; then
f_remove
fi
# installation----------------------------------------------------------
# on vire flashplugin-nonfree
if [ -d "/usr/lib/flashplugin-nonfree" ]; then
apt-get purge flashplugin-nonfree
fi
# architecture?
if [ "$(dpkg --print-architecture)" = "amd64" ]; then
architecture='x86_64'
else architecture='i386'
fi
# variables diverses
user_agent="Mozilla/5.0 (X11; Linux $architecture; rv:45.0) Gecko/20100101 Firefox/45.0"
url="https://get.adobe.com/flashplayer/"
version=$(wget --no-check-certificate --tries=1 --timeout=15 --user-agent=$user_agent -nv -qO - $url | \
grep "AUTO_ID_columnleft_p_version" | grep -o '[0-9].*[0-9]')
url="https://fpdownload.adobe.com/get/flashplayer/pdc/$version/"
file="flash_player_npapi_linux.$architecture.tar.gz"
# dossier temporaire de travail
mkdir -p /tmp/flash-file
cd /tmp/flash-file
# chargement flash
wget --user-agent="$user_agent" $url$file
# décompression archive téléchargée
tar xaf $file
# on place la bibliothèque et ce qu'il faut où il faut
cp libflashplayer.so /usr/lib/flashplugin-nonfree/
cp usr/bin/flash-player-properties /usr/bin/flash-player-properties
# on déclare flash dans les alternatives
update-alternatives --quiet --install /usr/lib/mozilla/plugins/flash-mozilla.so flash-mozilla.so \
/usr/lib/flashplugin-nonfree/libflashplayer.so 50
# on efface le dossier temporaire
cd ../
rm -rf flash-file
# si on est là, c'est que ça roule ;)
echo -e "Flash est bien installé, relancez firefox.\n\tPour essayer, allez sur http://get.adobe.com/flashplayer/about/"
exit 0
url="http://www.adobe.com/"
user_agent="Mozilla/5.0 (X11; Linux $arch; rv:45.0) Gecko/20100101 Firefox/45.0";
url="https://get.adobe.com/flashplayer/"
wget --no-check-certificate --tries=1 --timeout=15 --user-agent=$user_agent -nv -qO - $url
#AUTO_ID_columnleft_p_version
<p class="NoBottomMargin" id="AUTO_ID_columnleft_p_version"><strong>Version 25.0.0.171</strong></p>
grep "AUTO_ID_columnleft_p_version" adaube | grep -o '[0-9].*[0-9]'
wget --no-check-certificate --tries=1 --timeout=15 --user-agent=$user_agent -nv -qO - $url \
| grep "AUTO_ID_columnleft_p_version" | grep -o '[0-9].*[0-9]'
if [ dpkg-query -l 'flashplugin-nonfree' -eq 0 ]; then echo "0"; else echo "autre"; fi
if [ -d "/var/cache/flashplugin-nonfree" ];then
apt-get purge flashplugin-nonfree
else
echo "pas de paquets"
fi
url="https://fpdownload.adobe.com/get/flashplayer/pdc/$(perl /var/cache/flashplugin-nonfree/get-upstream-version.pl *)/# flash_player_npapi_linux.x$architecure.tar.gz
https://forum.ubuntu-fr.org/viewtopic.php?id=1303741