All pastes #131612 Raw Edit

Miscellany

public text v1 · immutable
#131612 ·published 2006-08-14 16:04 UTC
rendered paste body
#!/bin/sh
echo "### ZuZu Copyright ###"
echo "Voulez aller Décompresser et déplacer un fichier téléchargé depuis eMule vers la Bibliotheque de Musique, 
Continuer?"
read ouinon
case "$ouinon" in
y | Y | o | O )
 echo "OK quel est le fichier a décompresser?"
read file
echo "Quel est le format de compression? (rar zip tar.gz ou ace)"
read format
echo "Quel est le nom de l'artiste?"
read artiste;;
n | N ) echo "D'accord le programme va etre quitté, a bientot" && exit 0;;
* ) echo "Erreur lors de la saisie"
exit 0;;
esac
if [ -d "~/mp3/Bibliotheque/$artiste" ]; then
{
echo "OK l'Artiste $artiste est deja référencé dans la Bibliotheque"
}
else
{
echo "Le Dossier $artiste va etre cré dans la Bibliotheque" 
mkdir ~/mp3/Bibliotheque/$artiste
}
fi
rep="$file.$format"
rep2="$file$format"
case "format" in
rar ) unrar x ~/Desktop/Incoming/$rep && mv ~/Desktop/Incoming/$file ~/mp3/Bibliotheque/$artiste/
echo "Décompression de $file terminé";;
ace ) unrar x ~/Desktop/Incoming/$rep && mv ~/Desktop/Incoming/$file ~/mp3/Bibliotheque/$artiste/
echo "Décompression de $file terminé";;
zip ) unzip  ~/Desktop/Incoming/$rep && mv ~/Desktop/Incoming/$file ~/mp3/Bibliotheque/$artiste/
echo "Décompression de $file terminé";;
tar.gz ) tar tvzf ~/Desktop/Incoming/$rep && mv ~/Desktop/Incoming/$file ~/mp3/Bibliotheque/$artiste/
echo "Décompression de $file terminé";;
.rar ) unrar x ~/Desktop/Incoming/$rep2 && mv ~/Desktop/Incoming/$file ~/mp3/Bibliotheque/$artiste/
echo "Décompression de $file terminé";;
.ace ) unrar x ~/Desktop/Incoming/$rep2 && mv ~/Desktop/Incoming/$file ~/mp3/Bibliotheque/$artiste/
echo "Décompression de $file terminé";;
.zip ) unzip  ~/Desktop/Incoming/$rep2 && mv ~/Desktop/Incoming/$file ~/mp3/Bibliotheque/$artiste/
echo "Décompression de $file terminé";;
.tar.gz ) tar tvzf ~/Desktop/Incoming/$rep2 && mv ~/Desktop/Incoming/$file ~/mp3/Bibliotheque/$artiste/
echo "Décompression de $file terminé";;
esac

exit 0