Public domain
#!/bin/bash
if [ ! -d /root/install ]; then
echo " Backup install logs."
mkdir /root/install
mv /root/install.log /root/install.log.syslog /root/anaconda-ks.cfg /root/install
fi
if [ ! -d /root/disks ]; then
echo " Copy RH8.0 offcial disks."
mkdir /root/disks
echo " Insert RH8.0 Disk 1 and press ENTER . . ."
read
mkdir /root/disks/1
echo " Install eject."
mount /mnt/cdrom
rpm -ivh /mnt/cdrom/RedHat/RPMS/eject-2.0.12-7.i386.rpm
umount /mnt/cdrom
echo " Copy Disk 1."
mount /mnt/cdrom
cp /mnt/cdrom/RedHat/RPMS/* /root/disks/1
eject
echo " Insert RH8.0 Disk 2 and press ENTER . . ."
read
mkdir /root/disks/2
echo " Copy Disk 2."
mount /mnt/cdrom
cp /mnt/cdrom/RedHat/RPMS/* /root/disks/2
eject
echo " Insert RH8.0 Disk 3 and press ENTER . . ."
read
mkdir /root/disks/3
echo " Copy Disk 3."
mount /mnt/cdrom
cp /mnt/cdrom/RedHat/RPMS/* /root/disks/3
eject
fi
echo " Install RPMS."
if [ ! -d /root/RPMS ]; then
mkdir /root/RPMS
fi
if [ ! -d /root/RPMS/01-eject ]; then
echo " Install eject"
mkdir /root/RPMS/01-eject
cp /root/disks/1/eject-2.0.12-7.i386.rpm /root/RPMS/01-eject/
rpm -ivh /root/RPMS/01-eject/eject-2.0.12-7.i386.rpm
fi
if [ ! -d /root/RPMS/02-ntsysv ]; then
echo " Install ntsysv."
mkdir /root/RPMS/02-ntsysv
cp /root/disks/1/ntsysv-1.3.6-3.i386.rpm /root/RPMS/02-ntsysv/
rpm -ivh /root/RPMS/02-ntsysv/ntsysv-1.3.6-3.i386.rpm
fi
if [ ! -d /root/RPMS/03-iptables ]; then
echo " Install iptables."
mkdir /root/RPMS/03-iptables
cp /root/disks/1/iptables-1.2.6a-2.i386.rpm /root/RPMS/03-iptables/
rpm -ivh /root/RPMS/03-iptables/iptables-1.2.6a-2.i386.rpm
fi
if [ ! -d /root/RPMS/04-perl ]; then
echo " Install perl."
mkdir /root/RPMS/04-perl
cp /root/disks/1/perl-5.8.0-55.i386.rpm /root/RPMS/04-perl/
cp /root/disks/1/perl-Filter-1.28-9.i386.rpm /root/RPMS/04-perl/
cp /root/disks/1/perl-URI-1.21-3.noarch.rpm /root/RPMS/04-perl/
cp /root/disks/2/perl-CGI-2.81-55.i386.rpm /root/RPMS/04-perl/
cp /root/disks/2/perl-DBI-1.30-1.i386.rpm /root/RPMS/04-perl/
rpm -ivh /root/RPMS/04-perl/perl-Filter-1.28-9.i386.rpm --nodeps
rpm -ivh /root/RPMS/04-perl/perl-5.8.0-55.i386.rpm
rpm -ivh /root/RPMS/04-perl/perl-URI-1.21-3.noarch.rpm
rpm -ivh /root/RPMS/04-perl/perl-CGI-2.81-55.i386.rpm
rpm -ivh /root/RPMS/04-perl/perl-DBI-1.30-1.i386.rpm
fi
if [ ! -d /root/RPMS/05-gcc ]; then
echo "Install gcc."
mkdir /root/RPMS/05-gcc
cp /root/disks/1/gcc-3.2-7.i386.rpm /root/RPMS/05-gcc/
cp /root/disks/1/cpp-3.2-7.i386.rpm /root/RPMS/05-gcc/
cp /root/disks/1/binutils-2.13.90.0.2-2.i386.rpm /root/RPMS/05-gcc/
cp /root/disks/1/glibc-devel-2.2.93-5.i386.rpm /root/RPMS/05-gcc/
cp /root/disks/1/glibc-kernheaders-2.4-7.20.i386.rpm /root/RPMS/05-gcc/
rpm -ivh /root/RPMS/05-gcc/glibc-kernheaders-2.4-7.20.i386.rpm
rpm -ivh /root/RPMS/05-gcc/glibc-devel-2.2.93-5.i386.rpm
rpm -ivh /root/RPMS/05-gcc/binutils-2.13.90.0.2-2.i386.rpm
rpm -ivh /root/RPMS/05-gcc/cpp-3.2-7.i386.rpm
rpm -ivh /root/RPMS/05-gcc/gcc-3.2-7.i386.rpm
fi
if [ ! -d /root/RPMS/06-make ]; then
echo " Install make."
mkdir /root/RPMS/06-make
cp /root/disks/1/make-3.79.1-14.i386.rpm /root/RPMS/06-make/
rpm -ivh /root/RPMS/06-make/make-3.79.1-14.i386.rpm
fi
if [ ! -d /root/RPMS/07-patch ]; then
echo " Install patch."
mkdir /root/RPMS/07-patch
cp /root/disks/1/patch-2.5.4-14.i386.rpm /root/RPMS/07-patch/
rpm -ivh /root/RPMS/07-patch/patch-2.5.4-14.i386.rpm
fi
if [ ! -d /root/RPMS/08-ncurses ]; then
echo " Install ncurses."
mkdir /root/RPMS/08-ncurses
cp /root/disks/1/ncurses-devel-5.2-28.i386.rpm /root/RPMS/08-ncurses/
rpm -ivh /root/RPMS/08-ncurses/ncurses-devel-5.2-28.i386.rpm
fi
if [ ! -d /root/RPMS/09-bzip2 ]; then
echo " Install bzip2."
mkdir /root/RPMS/09-bzip2
cp /root/disks/1/bzip2-1.0.2-5.i386.rpm /root/RPMS/09-bzip2/
rpm -ivh /root/RPMS/09-bzip2/bzip2-1.0.2-5.i386.rpm
fi
if [ ! -d /root/RPMS/10-dhcp ]; then
echo " Install dhcp."
mkdir /root/RPMS/10-dhcp
cp /root/disks/2/dhcp-3.0pl1-9.i386.rpm /root/RPMS/10-dhcp/
cp /root/disks/1/dhclient-3.0pl1-9.i386.rpm /root/RPMS/10-dhcp/
rpm -ivh /root/RPMS/10-dhcp/dhcp-3.0pl1-9.i386.rpm
rpm -ivh /root/RPMS/10-dhcp/dhclient-3.0pl1-9.i386.rpm
fi
if [ ! -d /root/RPMS/11-named ]; then
echo " Install named."
mkdir /root/RPMS/11-named
cp /root/disks/1/caching-nameserver-7.2-4.noarch.rpm /root/RPMS/11-named/
cp /root/disks/1/bind-9.2.1-9.i386.rpm /root/RPMS/11-named/
cp /root/disks/1/bind-utils-9.2.1-9.i386.rpm /root/RPMS/11-named/
rpm -ivh /root/RPMS/11-named/bind-utils-9.2.1-9.i386.rpm
rpm -ivh /root/RPMS/11-named/bind-9.2.1-9.i386.rpm
rpm -ivh /root/RPMS/11-named/caching-nameserver-7.2-4.noarch.rpm
fi
if [ ! -d /root/RPMS/12-bridge ]; then
echo " Install bridge."
mkdir /root/RPMS/12-bridge
cp /root/disks/2/bridge-utils-0.9.3-6.i386.rpm /root/RPMS/12-bridge/
rpm -ivh /root/RPMS/12-bridge/bridge-utils-0.9.3-6.i386.rpm
fi
if [ ! -d /root/RPMS/13-cron ]; then
echo " Install cron."
mkdir /root/RPMS/13-cron
cp /root/disks/1/vixie-cron-3.0.1-69.i386.rpm /root/RPMS/13-cron/
cp /root/disks/1/crontabs-1.10-4.noarch.rpm /root/RPMS/13-cron/
rpm -ivh /root/RPMS/13-cron/vixie-cron-3.0.1-69.i386.rpm
rpm -ivh /root/RPMS/13-cron/crontabs-1.10-4.noarch.rpm
fi
if [ ! -d /root/RPMS/14-squid/ ]; then
echo " Install squid."
mkdir /root/RPMS/14-squid/
cp /root/disks/2/squid-2.4.STABLE7-4.i386.rpm /root/RPMS/14-squid/
cp /root/disks/1/logrotate-3.6.5-2.i386.rpm /root/RPMS/14-squid/
rpm -ivh /root/RPMS/14-squid/logrotate-3.6.5-2.i386.rpm
rpm -ivh /root/RPMS/14-squid/squid-2.4.STABLE7-4.i386.rpm
fi
if [ ! -d /root/RPMS/15-snmpd ]; then
echo " Install snmpd."
mkdir /root/RPMS/15-snmpd
cp /root/disks/1/net-snmp-5.0.1-6.i386.rpm /root/RPMS/15-snmpd/
cp /root/disks/1/net-snmp-utils-5.0.1-6.i386.rpm /root/RPMS/15-snmpd/
cp /root/disks/1/gnome-libs-1.4.1.2.90-22.i386.rpm /root/RPMS/15-snmpd/
rpm -ivh /root/RPMS/15-snmpd/gnome-libs-1.4.1.2.90-22.i386.rpm --nodeps
rpm -ivh /root/RPMS/15-snmpd/net-snmp-5.0.1-6.i386.rpm
rpm -ivh /root/RPMS/15-snmpd/net-snmp-utils-5.0.1-6.i386.rpm
fi
if [ ! -d /root/RPMS/16-mrtg ]; then
echo " Install mrtg."
mkdir /root/RPMS/16-mrtg
cp /root/disks/3/mrtg-2.9.17-8.i386.rpm /root/RPMS/16-mrtg/
cp /root/disks/1/gd-1.8.4-9.i386.rpm /root/RPMS/16-mrtg/
cp /root/disks/2/gd-devel-1.8.4-9.i386.rpm /root/RPMS/16-mrtg/
cp /root/disks/1/zlib-devel-1.1.4-4.i386.rpm /root/RPMS/16-mrtg/
cp /root/disks/1/libpng-1.2.2-6.i386.rpm /root/RPMS/16-mrtg/
cp /root/disks/2/libpng-devel-1.2.2-6.i386.rpm /root/RPMS/16-mrtg/
cp /root/disks/1/libjpeg-6b-21.i386.rpm /root/RPMS/16-mrtg/
cp /root/disks/1/freetype-2.1.2-7.i386.rpm /root/RPMS/16-mrtg/
rpm -ivh /root/RPMS/16-mrtg/freetype-2.1.2-7.i386.rpm
rpm -ivh /root/RPMS/16-mrtg/libjpeg-6b-21.i386.rpm
rpm -ivh /root/RPMS/16-mrtg/zlib-devel-1.1.4-4.i386.rpm
rpm -ivh /root/RPMS/16-mrtg/libpng-1.2.2-6.i386.rpm
rpm -ivh /root/RPMS/16-mrtg/libpng-devel-1.2.2-6.i386.rpm
rpm -ivh /root/RPMS/16-mrtg/gd-1.8.4-9.i386.rpm
rpm -ivh /root/RPMS/16-mrtg/gd-devel-1.8.4-9.i386.rpm
rpm -ivh /root/RPMS/16-mrtg/mrtg-2.9.17-8.i386.rpm
fi
if [ ! -d /root/RPMS/17-httpd ]; then
echo " Install httpd."
mkdir /root/RPMS/17-httpd
cp /root/disks/2/httpd-2.0.40-8.i386.rpm /root/RPMS/17-httpd/
cp /root/disks/1/mailcap-2.1.12-1.noarch.rpm /root/RPMS/17-httpd/
cp /root/disks/1/expat-1.95.4-1.i386.rpm /root/RPMS/17-httpd/
rpm -ivh /root/RPMS/17-httpd/mailcap-2.1.12-1.noarch.rpm
rpm -ivh /root/RPMS/17-httpd/expat-1.95.4-1.i386.rpm
rpm -ivh /root/RPMS/17-httpd/httpd-2.0.40-8.i386.rpm
fi
if [ ! -d /root/RPMS/18-ftp ]; then
echo " Install ftp."
mkdir /root/RPMS/18-ftp
cp /root/disks/1/ftp-0.17-15.i386.rpm /root/RPMS/18-ftp/
rpm -ivh /root/RPMS/18-ftp/ftp-0.17-15.i386.rpm
fi
if [ ! -d /root/RPMS/19-iptraf ]; then
echo " Install iptraf."
mkdir /root/RPMS/19-iptraf
cp /root/disks/3/iptraf-2.7.0-3.i386.rpm /root/RPMS/19-iptraf/
rpm -ivh /root/RPMS/19-iptraf/iptraf-2.7.0-3.i386.rpm
fi
if [ ! -d /root/RPMS/20-tcpdump/ ]; then
echo " Install tcpdump."
mkdir /root/RPMS/20-tcpdump/
cp /root/disks/1/tcpdump-3.6.3-3.i386.rpm /root/RPMS/20-tcpdump/
rpm -ivh /root/RPMS/20-tcpdump/tcpdump-3.6.3-3.i386.rpm
fi
if [ ! -d /root/RPMS/21-man ]; then
echo " Install man."
mkdir /root/RPMS/21-man
cp /root/disks/1/man-1.5j-11.i386.rpm /root/RPMS/21-man/
cp /root/disks/1/groff-1.18-6.i386.rpm /root/RPMS/21-man/
cp /root/disks/1/libstdc++-3.2-7.i386.rpm /root/RPMS/21-man/
rpm -ivh /root/RPMS/21-man/libstdc++-3.2-7.i386.rpm
rpm -ivh /root/RPMS/21-man/groff-1.18-6.i386.rpm
rpm -ivh /root/RPMS/21-man/man-1.5j-11.i386.rpm
fi
if [ ! -d /root/RPMS/22-ssh ]; then
echo " Install ssh."
mkdir /root/RPMS/22-ssh
cp /root/disks/1/openssh-3.4p1-2.i386.rpm /root/RPMS/22-ssh/
cp /root/disks/1/openssh-server-3.4p1-2.i386.rpm /root/RPMS/22-ssh/
cp /root/disks/1/openssh-clients-3.4p1-2.i386.rpm /root/RPMS/22-ssh/
rpm -ivh /root/RPMS/22-ssh/openssh-3.4p1-2.i386.rpm
rpm -ivh /root/RPMS/22-ssh/openssh-server-3.4p1-2.i386.rpm
rpm -ivh /root/RPMS/22-ssh/openssh-clients-3.4p1-2.i386.rpm
fi
if [ ! -d /root/RPMS/23-tree ]; then
echo " Install tree."
mkdir /root/RPMS/23-tree
cp /root/disks/3/tree-1.2-20.i386.rpm /root/RPMS/23-tree/
rpm -ivh /root/RPMS/23-tree/tree-1.2-20.i386.rpm
fi
if [ ! -d /root/RPMS/24-mc ]; then
echo " Install mc."
mkdir /root/RPMS/24-mc
cp /root/disks/3/mc-4.5.55-12.i386.rpm /root/RPMS/24-mc/
cp /root/disks/1/gpm-1.19.3-23.i386.rpm /root/RPMS/24-mc/
rpm -ivh /root/RPMS/24-mc/gpm-1.19.3-23.i386.rpm
rpm -ivh /root/RPMS/24-mc/mc-4.5.55-12.i386.rpm
fi
if [ ! -d /root/RPMS/25-zip ]; then
echo " Install zip."
mkdir /root/RPMS/25-zip
cp /root/disks/1/zip-2.3-14.i386.rpm /root/RPMS/25-zip/
cp /root/disks/1/unzip-5.50-5.i386.rpm /root/RPMS/25-zip/
rpm -ivh /root/RPMS/25-zip/zip-2.3-14.i386.rpm
rpm -ivh /root/RPMS/25-zip/unzip-5.50-5.i386.rpm
fi
if [ ! -d /root/RPMS/26-dosunix ]; then
echo " Install dosunix."
mkdir /root/RPMS/26-dosunix
cp /root/disks/1/dos2unix-3.1-12.i386.rpm /root/RPMS/26-dosunix/
cp /root/disks/1/unix2dos-2.2-17.i386.rpm /root/RPMS/26-dosunix/
rpm -ivh /root/RPMS/26-dosunix/dos2unix-3.1-12.i386.rpm
rpm -ivh /root/RPMS/26-dosunix/unix2dos-2.2-17.i386.rpm
fi
if [ ! -d /root/RPMS/27-traceroute ]; then
echo " Install traceroute."
mkdir /root/RPMS/27-traceroute
cp /root/disks/1/traceroute-1.4a12-6.i386.rpm /root/RPMS/27-traceroute/
rpm -ivh /root/RPMS/27-traceroute/traceroute-1.4a12-6.i386.rpm
fi
if [ ! -d /root/RPMS/28-wget ]; then
echo " Install wget."
mkdir /root/RPMS/28-wget
cp /root/disks/1/wget-1.8.2-3.i386.rpm /root/RPMS/28-wget/
rpm -ivh /root/RPMS/28-wget/wget-1.8.2-3.i386.rpm
fi
if [ ! -d /root/RPMS/29-lynx ]; then
echo " Install lynx."
mkdir /root/RPMS/29-lynx
cp /root/disks/2/indexhtml-8.0-1.noarch.rpm /root/RPMS/29-lynx/
cp /root/disks/3/lynx-2.8.5-7.i386.rpm /root/RPMS/29-lynx/
rpm -ivh /root/RPMS/29-lynx/indexhtml-8.0-1.noarch.rpm
rpm -ivh /root/RPMS/29-lynx/lynx-2.8.5-7.i386.rpm
fi
if [ ! -d /root/RPMS/30-bison ]; then
echo " Install bison."
mkdir /root/RPMS/30-bison
cp /root/disks/1/bison-1.35-4.i386.rpm /root/RPMS/30-bison/
rpm -ivh /root/RPMS/30-bison/bison-1.35-4.i386.rpm
fi
if [ ! -d /root/RPMS/31-flex ]; then
echo " Install flex."
mkdir /root/RPMS/31-flex
cp /root/disks/1/flex-2.5.4a-26.i386.rpm /root/RPMS/31-flex/
rpm -ivh /root/RPMS/31-flex/flex-2.5.4a-26.i386.rpm
fi
if [ ! -d /root/RPMS/32-byacc ]; then
echo " Install byacc."
mkdir /root/RPMS/32-byacc
cp /root/disks/1/byacc-1.9-22.i386.rpm /root/RPMS/32-byacc/
rpm -ivh /root/RPMS/32-byacc/byacc-1.9-22.i386.rpm
fi
if [ ! -d /root/RPMS/33-libpcap ]; then
echo " Install libpcap."
mkdir /root/RPMS/33-libpcap
cp /root/disks/2/libpcap-0.6.2-16.i386.rpm /root/RPMS/33-libpcap/
rpm -ivh /root/RPMS/33-libpcap/libpcap-0.6.2-16.i386.rpm
fi
if [ ! -d /root/RPMS/34-mkisofs ]; then
echo " Install mkisofs."
mkdir /root/RPMS/34-mkisofs
cp /root/disks/2/mkisofs-1.10-14.i386.rpm /root/RPMS/34-mkisofs/
rpm -ivh /root/RPMS/34-mkisofs/mkisofs-1.10-14.i386.rpm
fi
if [ ! -d /root/RPMS/35-mysql ]; then
echo " Install mysql."
mkdir /root/RPMS/35-mysql
cp /root/disks/3/perl-DBD-MySQL-2.1017-3.i386.rpm /root/RPMS/35-mysql/
cp /root/disks/3/mysql-3.23.52-3.i386.rpm /root/RPMS/35-mysql/
cp /root/disks/3/mysql-server-3.23.52-3.i386.rpm /root/RPMS/35-mysql/
rpm -ivh /root/RPMS/35-mysql/perl-DBD-MySQL-2.1017-3.i386.rpm --nodeps
rpm -ivh /root/RPMS/35-mysql/mysql-3.23.52-3.i386.rpm
rpm -ivh /root/RPMS/35-mysql/mysql-server-3.23.52-3.i386.rpm
fi
if [ ! -d /root/RPMS/36-php ]; then
echo " Install php."
mkdir /root/RPMS/36-php
cp /root/disks/1/gmp-4.1-4.i386.rpm /root/RPMS/36-php/
cp /root/disks/1/curl-7.9.8-1.i386.rpm /root/RPMS/36-php/
cp /root/disks/1/libxml2-2.4.23-1.i386.rpm /root/RPMS/36-php/
cp /root/disks/1/libtool-libs-1.4.2-12.i386.rpm /root/RPMS/36-php/
cp /root/disks/1/pspell-0.12.2-14.i386.rpm /root/RPMS/36-php/
cp /root/disks/2/php-4.2.2-8.0.5.i386.rpm /root/RPMS/36-php/
cp /root/disks/3/php-mysql-4.2.2-8.0.5.i386.rpm /root/RPMS/36-php/
rpm -ivh /root/RPMS/36-php/gmp-4.1-4.i386.rpm
rpm -ivh /root/RPMS/36-php/curl-7.9.8-1.i386.rpm
rpm -ivh /root/RPMS/36-php/libxml2-2.4.23-1.i386.rpm
rpm -ivh /root/RPMS/36-php/libtool-libs-1.4.2-12.i386.rpm
rpm -ivh /root/RPMS/36-php/pspell-0.12.2-14.i386.rpm
rpm -ivh /root/RPMS/36-php/php-4.2.2-8.0.5.i386.rpm
rpm -ivh /root/RPMS/36-php/php-mysql-4.2.2-8.0.5.i386.rpm
fi
echo " httpd.conf adjustment."
echo "ServerName 127.0.0.1:80" >> /etc/httpd/conf/httpd.conf
echo " System configuration."
echo " UTF-8 destroy."
echo "LANG=\"en_US\"" > /etc/sysconfig/i18n
echo "SUPPORTED=\"en_US:en\"" >> /etc/sysconfig/i18n
echo "SYSFONT=\"latarcyrheb-sun16\"" >> /etc/sysconfig/i18n
ntsysv --level 2345
reboot
BY: Pejman Moghadam
TAG: customizer, bash, bash-script
DATE: 2007-07-01 13:49:25