script to install easy codecs and necessary software

Please help to make a script that saves time and also make easier for new users to configure the newly installed system!I apply what I wrote;
Please give suggestions for improvements by posting code!
:wink:

#!/bin/bash
# First  update system
# This script install openSuse 11.3 software
# Your need to be root

x=$(cat /etc/SuSE-release |grep VERSION | cut -d\. -f2)

if  $x -eq 3 ]
   then 
echo " "
printf "\e2J"
printf "\e0;34m     >>>THIS SCRIPT INSTALL CODECS AND SOFTOWARE FOR OPEN SUSE 11.3<<<
"
echo " "
   else printf "\e5;31m YOUR VERSION IS NOT 11.3 END OF THE INSTALLATION! 
 "
printf "\e1;32m\e"
fi


#Add repos
SUSE_VERSION=$(awk '/^VERSION/{print $3}' /etc/SuSE-release)
URL=http://opensuse-community.org/subpixel/openSUSE_${SUSE_VERSION}/subpixel.repo 
zypper ar --repo "$URL" 
zypper ref subpixel 
zypper up -t package -r subpixel
zypper in freetype2-feature-subpixel-hinting
zypper ar -f http://download.opensuse.org/repositories/KDE:/KDE4:/Community/openSUSE_${SUSE_VERSION} KDE4
zypper ar -f http://download.opensuse.org/repositories/KDE:/Community/openSUSE_${SUSE_VERSION}/ Community
zypper ar -f http://ftp.skynet.be/pub/packman/suse/${SUSE_VERSION}/ Packman
zypper ar -f http://www.opensuse-guide.org/repo/${SUSE_VERSION} libdvdcss

# Install codecs
zypper in -y -l ffmpeg flash-player gst-fluendo-mp3 k3b-codecs libdvdcss 
libxine1-codecs phonon-backend-xine w32codec-all  gstreamer-0_10-ffmpeg 
gstreamer-0_10-fluendo-mp3 gstreamer-0_10-fluendo-mpegdemux 
gstreamer-0_10-fluendo-mpegmux gstreamer-0_10-plugins-bad gstreamer-0_10-plugins-base 
gstreamer-0_10-plugins-good gstreamer-0_10-plugins-good-extra 
gstreamer-0_10-plugins-ugly xvidcore xivd4conf libmad0 mplayerplug-in java-1_6_0-sun-plugin


# Install software 
zypper in -y  acetoneiso2 minitube vlc MPlayer SMPlayer wine rar unrar audiokonverter xine-ui kchmviewer 


#Install Skaype
wget -q http://www.skype.com/go/getskype-linux-beta-suse
zypper in -y ~/skype-2.1.0.81-suse.i586.rpm

init 6

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Save time… why the reboot at the end?

Good luck.

On 07/07/2010 10:36 AM, NikolaiSS wrote:
>
> Please help to make a script that saves time and also make easier for
> new users to configure the newly installed system!I apply what I wrote;
>
> Please give suggestions for improvements by posting code!
> :wink:
>
> Code:
> --------------------
> #!/bin/bash
> # First update system
> # This script install openSuse 11.3 software
> # Your need to be root
>
> x=$(cat /etc/SuSE-release |grep VERSION | cut -d. -f2)
>
> if $x -eq 3 ]
> then
> echo " "
> printf β€œ\e2J”
> printf "\e0;34m >>>THIS SCRIPT INSTALL CODECS AND SOFTOWARE FOR OPEN SUSE 11.3<<<
"
> echo " "
> else printf "\e5;31m YOUR VERSION IS NOT 11.3 END OF THE INSTALLATION!
"
> printf β€œ\e1;32m\e”
> fi
>
>
> #Add repos
> SUSE_VERSION=$(awk β€˜/^VERSION/{print $3}’ /etc/SuSE-release)
> URL=http://opensuse-community.org/subpixel/openSUSE_${SUSE_VERSION}/subpixel.repo
> zypper ar --repo β€œ$URL”
> zypper ref subpixel
> zypper up -t package -r subpixel
> zypper in freetype2-feature-subpixel-hinting
> zypper ar -f http://download.opensuse.org/repositories/KDE:/KDE4:/Community/openSUSE_${SUSE_VERSION} KDE4
> zypper ar -f http://download.opensuse.org/repositories/KDE:/Community/openSUSE_${SUSE_VERSION}/ Community
> zypper ar -f http://ftp.skynet.be/pub/packman/suse/${SUSE_VERSION}/ Packman
> zypper ar -f http://www.opensuse-guide.org/repo/${SUSE_VERSION} libdvdcss
>
> # Install codecs
> zypper in -y -l ffmpeg flash-player gst-fluendo-mp3 k3b-codecs libdvdcss
> libxine1-codecs phonon-backend-xine w32codec-all gstreamer-0_10-ffmpeg
> gstreamer-0_10-fluendo-mp3 gstreamer-0_10-fluendo-mpegdemux
> gstreamer-0_10-fluendo-mpegmux gstreamer-0_10-plugins-bad gstreamer-0_10-plugins-base
> gstreamer-0_10-plugins-good gstreamer-0_10-plugins-good-extra
> gstreamer-0_10-plugins-ugly xvidcore xivd4conf libmad0 mplayerplug-in java-1_6_0-sun-plugin
>
>
> # Install software
> zypper in -y acetoneiso2 minitube vlc MPlayer SMPlayer wine rar unrar audiokonverter xine-ui kchmviewer
>
>
> #Install Skaype
> wget -q http://www.skype.com/go/getskype-linux-beta-suse
> zypper in -y ~/skype-2.1.0.81-suse.i586.rpm
>
> init 6
>
> --------------------
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJMNK0mAAoJEF+XTK08PnB5LcwP+QHluyKUrfQRCqgEplcrpU2K
cG18BKrzwbI0LZKdb44pKAwblfPfL2pQQZbS4HdWfOtZUmlRdnt66hBPtvwOH0is
swE+KK2IqPvaF9+wpm0XywOfdFtIL/cKZF91Rgya/j0HABHUaMehG6g3IaxhvY17
W99YtqC4VpfV8Gm1UCqZ48jOaWr+JmOkhM9JD8K0BXbWQhgEtcRnFJg5eK2iA+ew
BgBR2AAxLaz7I1TqfkNBLMdjZ0iNX9TP6gUNdV/BQmIlIevhQqD4gUJBrUj4LLID
mehCrmGyLl2Qv5QNOasrwG3ACXPPFtdIrx7cnfiFTynjP6F+oVZ+g4eAWzDvYJOT
MqDlbh4+zQvKvALkEmW4gzudEhYXZqB1YRGNCN4MovgdV1EXN1JDWhmjWHE4HN7U
++cB8Dew/lZGxd3FYG4zPg09uvvqUnJjjWSotKu5qt2/8IK/FQmPi485it2PznzE
8f225nlOqBaPaX75wdl6aLxTrSWy0LpbG7BEaeORSizzVhJI/XYVrGqV7Rd1SojF
BhVUX9DsiC2j5rs+Tg+C5DfI2Yuv+M1AM7flfx1+xzzfBDdhfLgALVxvVri5QZh2
Vx59KKviAqv3dhaBTvI2ctyht3fXuXrrj6+ZId+UH+MsEybpnQMmJPJmlTmXEjTB
fLVbGcjDZlEOUWEX6qPz
=CfzU
-----END PGP SIGNATURE-----

Check out Zypper own switch β€œtos”

 zypper tos
openSUSE-11.3-i586

which gives you the Target-OS already.
It might be a little bit more elegant to set-up the URL.

cat /etc/SuSE-release |grep VERSION = lsb_release -s -r