Pages : 1
#1 Le 20/11/2007, à 17:47
- Sebome
Que pensez-vous de mon script?
Bonjour à tous,
J'ai fais un petit script pour après une installation de Ubuntu Gutsy je n'ai juste a cocher ce que je veux installer et op ca déroule tout seul...
Je voudrai avoir votre avis dessus (savoir ce qui est bien et pas bien et ce qui peux être amélioré)
#!/bin/sh
# Question
if zenity --question --title "Ubuntu 7.10" --text "
Vous utilisez `cat /etc/issue.net`
Vous devez avoir une connection internet active!
Voulez vous installer des logiciels pour Ubuntu 7.10 ?";
then
# Affiche la fentre de sélection
RET=`zenity --list --checklist --width=500 --height=350 \
--title "Choix des logiciels" \
--column="" --column "Catégorie" --column "Description" \
FALSE "Usplash" "Mise à jour de uspash.conf pour les problèmes de démarrage" \
TRUE "Sources-List" "Mise à jour de sources.list" \
TRUE "Programmation" "gcc g++ ect.." \
TRUE "Emacs" "emacs" \
TRUE "Audio-Video" "codecs ect..." \
TRUE "Tableur" "Gnumeric" \
TRUE "Client-FTP" "filezilla" \
FALSE "Serveur-FTP" "proftpd gproftpd" \
FALSE "Serveur-ssh" "openssh-serveur" \
TRUE "VLC" "vlc" \
TRUE "Gmountiso" "Monter des iso" \
TRUE "Unrar" "Décomprésser les rar" \
TRUE "Gravure" "gnomebaker" \
TRUE "Java" "java" \
TRUE "Flash-Player" "Flash Player" \
FALSE "numlockx" "Verrouiller pavé numérique" \
TRUE "Amsn" "Client MSN pour Linux" \
TRUE "fonts" "Polices" \
TRUE "maj" "Mise à jour système" \
TRUE "Firewall" "firestarter"`
if echo "$RET" | grep "Usplash"; then
sudo echo "# Usplash configuration file" > /etc/usplash.conf
sudo echo "xres=1024" >> /etc/usplash.conf
sudo echo "768" >> /etc/usplash.conf
sudo update-initramfs -u
fi
if echo "$RET" | grep "Sources-List"; then
sudo cat sources.list > /etc/apt/sources.list
wget -q http://fr.packages.medibuntu.org/medibuntu-key.gpg -O- | sudo apt-key add -
wget -q http://lut1n.ifrance.com/repo_key.asc -O- | sudo apt-key add -
wget -q http://wine.budgetdedicated.com/apt/387EE263.gpg -O- | sudo apt-key add -
sudo apt-get update
fi
if echo "$RET" | grep "Programmation"; then
sudo apt-get install build-essential -f -y
fi
if echo "$RET" | grep "Firewall"; then
sudo apt-get install firestarter -f -y
fi
if echo "$RET" | grep "Emacs"; then
sudo apt-get install emacs22-gtk -f -y
fi
if echo "$RET" | grep "Audio-Video"; then
sudo apt-get install w32codecs gstreamer0.10-plugins-ugly gstreamer0.10-ffmpeg gstreamer0.10-pitfdll libdvdcss2 totem-gstreamer gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-bad xchm -f -y
fi
if echo "$RET" | grep "Tableur"; then
sudo apt-get install gnumeric -f -y
fi
if echo "$RET" | grep "Client-FTP"; then
sudo apt-get install filezilla -f -y
fi
if echo "$RET" | grep "Serveur-FTP"; then
sudo apt-get install proftpd gproftpd -f -y
fi
if echo "$RET" | grep "Serveur-ssh"; then
sudo apt-get install openssh-server -f -y
fi
if echo "$RET" | grep "VLC"; then
sudo apt-get install vlc -f -y
fi
if echo "$RET" | grep "Gmountiso"; then
sudo apt-get install gmountiso -f -y
fi
if echo "$RET" | grep "Unrar"; then
sudo apt-get install unrar unrar-free -f -y
fi
if echo "$RET" | grep "Gravure"; then
sudo apt-get install gnomebaker -f -y
fi
if echo "$RET" | grep "Java"; then
sudo apt-get install sun-java6-bin sun-java6-font sun-java6-plugin -f -y
fi
if echo "$RET" | grep "Flash-Player"; then
sudo apt-get install flashplugin-nonfree -f -y
fi
if echo "$RET" | grep "numlockx"; then
sudo apt-get install numlockx -f -y
a='cat /etc/gdm/Init/Default'
if $a | grep "numlockx"
then
echo "Aucune modification de Default"
else
sudo sed -i '4a test -x /usr/bin/numlockx && /usr/bin/numlockx on ' /etc/gdm/Init/Default
fi
fi
if echo "$RET" | grep "Amsn"; then
sudo apt-get install amsn -f -y
fi
if echo "$RET" | grep "fonts"; then
sudo apt-get install msttcorefonts
sudo fc-cache -f -v
fi
if echo "$RET" | grep "maj"; then
sudo apt-get upgrade
fi
zenity --info --title "Ubuntu 7.10" --text "Installation terminée!";
fi
# Fin
Je vous remercie d'avance pour vos critiques constructives.
Cordialement
Sebome
Hors ligne
#2 Le 20/11/2007, à 19:42
- mekare
Re : Que pensez-vous de mon script?
Sebome a écrit :
sudo echo "768" >> /etc/usplash.conf
C'est pas plutot :
sudo echo "yres=768" >> /etc/usplash.conf
???
Hors ligne
#3 Le 21/11/2007, à 11:06
- Sebome
Re : Que pensez-vous de mon script?
oui exacte!
Merci
Hors ligne