#!/bin/sh ######################### ATTENTION !!! ############################## # # # Cette bibliothèque est Copyright (C) Centre de Ressources # # Informatiques - AED - Conseil Général de la Haute Savoie # # Ce programme est Copyright (C) Fabien Salvi # # # # Cette bibliothèque est distribuée sous la Licence 2 GNU GPL # # Cette bibliothèque est distribuée car potentiellement utile mais # # SANS AUCUNE GARANTIE, ni explicite, ni implicite, y compris les # # garanties de commercialisation ou d'adaptation dans un but # # spécifique. Reportez vous à la Licence Publique Générale GNU pour # # plus de détails. # # # ###################################################################### ############################ WARNING !!! ############################# # # # This Library is Copyright (C) Centre de Ressources Informatiques # # - AED - Conseil Général de la Haute Savoie # # This program is Copyright (C) Fabien Salvi # # # # This Library is distributed under GNU GPL License 2. # # This Libray is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # See the GPL.txt file for more information about the license. # # # ###################################################################### ###################################################################### # Prog: aptgetli # # $@PROG@-@Version@$: 1.00 # # Created By: fabien@cri74.org # # Date: 21/07/1999 # # Last modification: 01/02/2000 # # Description: installation script for PingOO distribution # ###################################################################### error_exit () { echo "" echo "==============================" echo "Process is stopped, problem..." if [ "$INSTALL_SUPPORT" = cdrom ] then sleep 4 umount /cdrom [ $? -ne 0 ] && error_exit echo "cd-rom unmounted..." fi exit 1 } echo "Installing the PingOO system..." DOMAIN_MAIL_PINGOO=`grep "^DOMAIN_MAIL_PINGOO" /etc/PingOO/PingOO.conf |awk -F ' = ' '{print $2}'` HOSTNAME=`grep "^HOSTNAME" /etc/PingOO/PingOO.conf |awk -F ' = ' '{print $2}'` USE_NTP=`grep "^USE_NTP" /etc/PingOO/PingOO.conf |awk -F ' = ' '{print $2}'` USE_UUCP=`grep "^MAIL_METHOD" /etc/PingOO/PingOO.conf |awk -F ' = ' '{print $2}'` USE_BACKUP=`grep "^USE_BACKUP" /etc/PingOO/PingOO.conf |awk -F ' = ' '{print $2}'` USE_UPS=`grep "^USE_UPS" /etc/PingOO/PingOO.conf |awk -F ' = ' '{print $2}'` USE_FILE_SERVER=`grep "^USE_FILE_SERVER" /etc/PingOO/PingOO.conf |awk -F ' = ' '{print $2}'` USE_DHCP_SERVER=`grep "^USE_DHCP_SERVER" /etc/PingOO/PingOO.conf |awk -F ' = ' '{print $2}'` USE_ISDN=`grep "^USE_ISDN" /etc/PingOO/PingOO.conf |awk -F ' = ' '{print $2}'` INSTALL_SUPPORT=`grep "^INSTALL_SUPPORT" /etc/PingOO/PingOO.conf |awk -F ' = ' '{print $2}'` INSTALL_ADDRESS_1=`grep "^INSTALL_ADDRESS_1" /etc/PingOO/PingOO.conf |awk -F ' = ' '{print $2}'` INSTALL_ADDRESS_2=`grep "^INSTALL_ADDRESS_2" /etc/PingOO/PingOO.conf |awk -F ' = ' '{print $2}'` INSTALL_ADDRESS_3=`grep "^INSTALL_ADDRESS_3" /etc/PingOO/PingOO.conf |awk -F ' = ' '{print $2}'` echo "Installation support : $INSTALL_SUPPORT " if [ "$INSTALL_SUPPORT" = cdrom ] then echo "Put the PingOO cdrom in the drive and press Enter : " read tmp mount -t iso9660 /dev/cdrom /cdrom [ $? -ne 0 ] && error_exit echo "OK..." fi echo "write the sources.list for apt-get" if [ -z "$INSTALL_ADDRESS_1" ] then echo "Problem with your PingOO.conf at install section" echo "Installation aborted" exit 1 else echo "deb $INSTALL_ADDRESS_1" > /etc/apt/sources.list fi if [ ! -z "$INSTALL_ADDRESS_2" ] then echo "deb $INSTALL_ADDRESS_2" >> /etc/apt/sources.list fi if [ ! -z "$INSTALL_ADDRESS_3" ] then echo "deb $INSTALL_ADDRESS_3" >> /etc/apt/sources.list fi echo "Start installation from :" cat /etc/apt/sources.list echo "---------------------------------------------------------" echo "$HOSTNAME.$DOMAIN_MAIL_PINGOO" > /etc/mailname apt-get -y update [ $? -ne 0 ] && error_exit ### here is the install for the packages from perl-base to sympa... echo "" for pkg_to_install in `cat /root/PingOO/listpkgs` do echo "installing $pkg_to_install ..." apt-get -y install $pkg_to_install [ $? -ne 0 ] && error_exit echo "$pkg_to_install installed !" echo "" done ### put symlinks for devices ROOT et BOOT echo "write the goods lilo.conf and fstab :" chmod 755 /usr/sbin/mkpingoofs /usr/sbin/mkpingoofs echo "Done !" chmod 600 /usr/sbin/mkpingoofs echo "installing pingoo-server ..." apt-get -y install pingoo-server [ $? -ne 0 ] && error_exit echo "pingoo-server installed !" echo "installing bind ..." apt-get -y install bind [ $? -ne 0 ] && error_exit echo "bind installed !" echo "ntp : $USE_NTP" if [ $USE_NTP = yes ] then echo "installing xntp3 ..." apt-get -y install xntp3 [ $? -ne 0 ] && error_exit echo "xntp3 installed !" else echo "xntp3 will not be installed" fi echo "mail method : $USE_UUCP" if [ $USE_UUCP = uucp ] then echo "installing synchro-mail ..." apt-get -y install synchro-mail [ $? -ne 0 ] && error_exit echo "synchro-mail installed !" else echo "synchro-mail will not be installed" fi ## makedev for tape travan echo "installing devices for tape" cd /dev ; ./MAKEDEV ht ; ./MAKEDEV st0 echo "backup : $USE_BACKUP" if [ $USE_BACKUP = yes ] then echo "installing taper ..." apt-get -y install taper [ $? -ne 0 ] && error_exit echo "taper installed !" else echo "taper will not be installed" fi echo "ups : $USE_UPS" if [ $USE_UPS = yes ] then echo "installing mgeups ..." apt-get -y install mgeups [ $? -ne 0 ] && error_exit echo "mgeups installed !" else echo "mgeups will not be installed" fi ################## ### kbd modification ###### echo "installing patch-kbd ..." apt-get -y install patch-kbd [ $? -ne 0 ] && error_exit echo "patch-kbd installed !" ### use file server ##### echo "File server : $USE_FILE_SERVER" if [ $USE_FILE_SERVER = yes ] then echo "installing lprng ..." apt-get -y install lprng [ $? -ne 0 ] && error_exit echo "lprng installed !" else echo "lprng will not be installed" fi ### use dhcp server ##### echo "File server : $USE_DHCP_SERVER" if [ $USE_DHCP_SERVER = yes ] then echo "installing dhcp ..." apt-get -y install dhcp [ $? -ne 0 ] && error_exit echo "dhcp installed !" else echo "dhcp will not be installed" fi ### use isdn ##### echo "Isdn Router : $USE_ISDN" if [ $USE_ISDN = yes ] then echo "installing isdn ..." apt-get -y install task-isdn [ $? -ne 0 ] && error_exit echo "isdn installed !" else echo "isdn will not be installed" fi ############## # install the new kernel echo "installing the new linux kernel" apt-get install -y kernel-image-2.2.16 [ $? -ne 0 ] && error_exit echo "linux kernel installed !" ############### # maintenance ##### echo "Save current sources.list" cp -f /etc/apt/sources.list /etc/apt/sources.list_for_installation echo "installing maintenance ..." apt-get -y install maintenance [ $? -ne 0 ] && error_exit echo "maintenance installed !" cp -f /etc/apt/sources.list /etc/apt/sources.list_for_maintenance cp -f /etc/apt/sources.list_for_installation /etc/apt/sources.list apt-get update ############### # network configuration # - /etc/init.d/networks # - /etc/resolv.conf # just before reboot !! # echo "installing ipconfig ..." apt-get -y install ipconfig [ $? -ne 0 ] && error_exit echo "ipconfig installed !" cp -f /etc/apt/sources.list_for_maintenance /etc/apt/sources.list ############## apt-get clean if [ "$INSTALL_SUPPORT" = cdrom ] then sleep 4 umount /cdrom [ $? -ne 0 ] && error_exit echo "cd-rom unmounted..." fi echo "Remove cd-rom and floppy-disk and press Enter : " read tmp2 echo "Installation finished !!!!" echo "****************************" echo "You must reboot the machine now !!"