home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.ac-grenoble.fr
/
2015.02.ftp.ac-grenoble.fr.tar
/
ftp.ac-grenoble.fr
/
pub
/
slis
/
updates_rsync
/
slis_update-1.3
< prev
next >
Wrap
Text File
|
2001-02-01
|
29KB
|
965 lines
#!/bin/bash
# Script de mise α jour tΘlΘchargΘ rΘguliΦrement par rsync par tous les
# serveurs SLIS dans les Θtablissements.
# Script pour les SLIS version 1.3
# Ce script est une conversion du script destine a l'ancien systeme (tftp)
# jusqu'a la MAJ 136
# This script is part of the SLIS Project initiated by the CARMI-Internet
# (AcadΘmie de Grenoble - France 38).
# Ce script fait partie du projet SLIS dΘmarrΘ par le CARMI-Internet
# (AcadΘmie de Grenoble - France 38).
#
# SLIS : Serveur de communications Linux pour l'Internet Scolaire.
# Copyright (C) 1998-2000 Bruno Bzeznik
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program 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
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program (For example ./COPYING);
# if not, write to the Free Software Foundation, Inc., 675 Mass Ave,
# Cambridge, MA 02139, USA.
#
# Please send all comments and bug reports by electronic mail to:
# Bruno Bzeznik <Bruno@ac-grenoble.fr>
# or to <slis@ac-grenoble.fr>
#
# Envoyez vos suggestions et reports de bugs par e-mail α
# Bruno Bzeznik <Bruno@ac-grenoble.fr>
# ou α <slis@ac-grenoble.fr>
#
### VARIABLES ###
UPDDIR=/home/hadmin/updates # Rep pour les flags
LOGTAG="slis_update[$$]" # Ce qui apparait en syslog
PAS_UPD_KERNEL=0 # Si ce flag est a un, alors la mise a jour du noyau
# (qui necessite reboot) ne sera pas faite cette fois.
# Recuperation de la variable HOSTNAME :
grep HOSTNAME /etc/sysconfig/network > /tmp/hostname
. /tmp/hostname
rm -rf /tmp/hostname
QUEUE=/home/hadmin/cgi-bin/queue # File d'attente SLIS
BASE=/home/hadmin/cgi-bin/base # Base SLIS
BINDIR=/usr/local/sbin # Scripts et binaires SLIS
ACAD_DOMAIN=ac-grenoble.fr # Domaine
MAILSERVER=pluton # Serveur de messagerie du domaine (nom sans le domaine)
IPMAILSERVER=193.54.149.10 # Adresse ip du serveur de messagerie
TFTP=pluton.ac-grenoble.fr # Serveur tftp des mises α jour (obsolete)
RSYNC=pluton.ac-grenoble.fr # Serveur rsync des mises α jour
MODULE=slis-updates # Module rsync du serveur des mises α jour
FTP=ftp.ac-grenoble.fr # Serveur anonyme de mises α jour RedHat
TIME=pluton.ac-grenoble.fr # Serveur d'heure
SLISMASTER=Bruno@ac-grenoble.fr # Administrateur acadΘmique SLIS
WEBMASTER=`ls -ld /home/httpd/html |awk '{print $3}'` # Webmaster designΘ par l'admin local
. /home/hadmin/slis.conf
##################
# Gestion d'un lock
if [ -e /var/lock/slis_upd ]
then
logger -t "$LOGTAG" "Deja en cours. Abandon."
exit
fi
touch /var/lock/slis_upd
sleep 1
logger -t "$LOGTAG" "Script Version 1.3 Debut."
############################################################################
### Mise a jour 137 - 04/07/2000
# Update securite wu_ftpd
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/137 \) ]
then
cd /tmp
rsync rsync://$RSYNC/$MODULE/wu-ftpd-2.6.0-2.5.x.i386.rpm .
rpm -U ./wu-ftpd-2.6.0-2.5.x.i386.rpm
touch $UPDDIR/137
logger -t "$LOGTAG" "Update 137 effectuee."
fi
###
############################################################################
### Mise a jour 1.3-6 - 31/08/2000
# Update securite makewhatis
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/1.3-6 \) ]
then
cd /tmp
rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/man-1.5h1-2.5.x.i386.rpm .
rpm -U ./man-1.5h1-2.5.x.i386.rpm
touch $UPDDIR/1.3-6
logger -t "$LOGTAG" "Update 1.3-6 effectuee."
fi
###
############################################################################
### Mise a jour 1.3-7 - 18/09/2000
# Update securite portmap (sunrpc udp/tcp 111)
# Arret et suppression de portmap
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/1.3-7 \) ]
then
/etc/rc.d/init.d/portmap stop
rpm -e yp-tools
rpm -e ypbind
rpm -e portmap
touch $UPDDIR/1.3-7
logger -t "$LOGTAG" "Update 1.3-7 effectuee."
fi
###
############################################################################
### Mise a jour 1.3-8b - 27/09/2000
# Nouvelle fonction: aspiration de sites
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/1.3-8b \) ]
then
cd /tmp
rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/wget-1.5.3-2.i386.rpm .
rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-web-get.tgz .
rpm -U ./wget-1.5.3-2.i386.rpm
cd /
tar zxf /tmp/upd-web-get.tgz
$SLIS_BINDIR/mkwgetlauncher
touch $UPDDIR/1.3-8b
logger -t "$LOGTAG" "Update 1.3-8b effectuee."
fi
###
############################################################################
### Mise a jour CS-1b - 28/09/2000
# Ameliorations fonction aspiration de sites
# Rend obsolete : 2.0-9,2.0-9b,2.0-9c
############################################################################
if [ ! \( -e $UPDDIR/CS-1b \) ]
then
cd /tmp
rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-web-get-1.tgz .
cd /
tar zxf /tmp/upd-web-get-1.tgz
# Generation d'une heure de mirroring aleatoire
r=`/usr/local/sbin/rand60`
if [ $r -ge 0 -a $r -lt 10 ]; then h="21"; fi
if [ $r -ge 10 -a $r -lt 20 ]; then h="22"; fi
if [ $r -ge 20 -a $r -lt 30 ]; then h="23"; fi
if [ $r -ge 30 -a $r -lt 40 ]; then h="00"; fi
if [ $r -ge 40 -a $r -lt 50 ]; then h="01"; fi
if [ $r -ge 50 ]; then h="02"; fi
$SLIS_BINDIR/remplace 23 $h $SLIS_BINDIR/mkwgetlauncher
mkdir /home/httpd/html/miroirs
touch /home/httpd/html/miroirs/.miroirs
chmod 755 $SLIS_BINDIR/mkwgetlauncher
$SLIS_BINDIR/mkwgetlauncher
touch $UPDDIR/CS-1b
logger -t "$LOGTAG" "Update CS-1b effectuee."
fi
###
############################################################################
### Mise a jour CS-2 - 02/10/2000
# Correction de quelques petits bugs:
# - web_get*: simplification et modif de la fonction d'aspiration et ajout
# d'explications sur la recursivite. Correc faute d'orthographe.
# - users_listdel.html: message "obsolete"
# - squid_purge: ajout d'un GMT-2 pour workaround heures affichees par prostat
# Rend obsolete : CS-2
############################################################################
if [ ! \( -e $UPDDIR/CS-2 \) ]
then
cd /tmp
rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-CS-2.tgz .
cd /
tar zxf /tmp/upd-CS-2.tgz
touch $UPDDIR/CS-2
logger -t "$LOGTAG" "Update CS-2 effectuee."
fi
###
############################################################################
### Mise a jour 1.3-10 - 02/10/2000
# Update securite syslog
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/1.3-10 \) ]
then
cd /tmp
rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/sysklogd-1.3.31-1.6.i386.rpm .
rpm -U ./sysklogd-1.3.31-1.6.i386.rpm
/etc/rc.d/init.d/syslog restart
touch $UPDDIR/1.3-10
logger -t "$LOGTAG" "Update 1.3-10 effectuee."
fi
###
############################################################################
### Mise a jour 1.3-11 - 09/10/2000
# Ajout du code mime de shockwave
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/1.3-11 \) ]
then
echo "application/x-shockwave-flash swf" >> /etc/mime.types
echo "application/x-shockwave-flash swf" >> /usr/local/etc/mime.types
touch $UPDDIR/1.3-11
logger -t "$LOGTAG" "Update 1.3-11 effectuee."
fi
###
############################################################################
### Mise a jour 1.3-13 - 22/10/2000
# Nouveau binaire sendmail et nouvelle conf avec anti-spam
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/1.3-13 \) ]
then
# Telechargement de l'update
cd /tmp
rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-1.x-13.tgz .
# Arret de sendmail
/etc/rc.d/init.d/sendmail stop >/dev/null 2>/dev/null
sleep 3
/etc/rc.d/init.d/sendmail stop >/dev/null 2>/dev/null
sleep 1
killall -9 sendmail >/dev/null 2>/dev/null
# Si apres ca, il n'est pas mort..!
# Decompactage
cd /
tar zxf /tmp/upd-1.x-13.tgz
touch /etc/mail/statistics
ln -s /etc/sendmail.cf /etc/mail/sendmail.cf
# Lancement du configurateur
$SLIS_BINDIR/mksendmailcf
# Demarrage de sendmail
/etc/rc.d/init.d/sendmail start >/dev/null 2>/dev/null
touch $UPDDIR/1.3-13
logger -t "$LOGTAG" "Update 1.3-13 effectuee."
fi
###
############################################################################
### Mise a jour CS-3 - 26/10/2000
# Nouveau sendmail.cf
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/CS-3 \) ]
then
# Telechargement de l'update
cd /etc
rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/sendmail.cf.slis.gz .
rm -rf sendmail.cf.slis
gzip -d sendmail.cf.slis.gz
# Arret de sendmail
/etc/rc.d/init.d/sendmail stop >/dev/null 2>/dev/null
sleep 3
/etc/rc.d/init.d/sendmail stop >/dev/null 2>/dev/null
sleep 1
killall -9 sendmail >/dev/null 2>/dev/null
# Si apres ca, il n'est pas mort..!
# Lancement du configurateur
$SLIS_BINDIR/mksendmailcf
# Demarrage de sendmail
/etc/rc.d/init.d/sendmail start >/dev/null 2>/dev/null
touch $UPDDIR/CS-3
logger -t "$LOGTAG" "Update CS-3 effectuee."
fi
###
############################################################################
### Mise a jour CS-5 - 04/12/2000
# Bug de mkwgetlaucher et mkpushsiteconf (crontab mal programmee)
# Rend obsolete : C-5
############################################################################
if [ ! \( -e $UPDDIR/CS-5 \) ]
then
# Aspiration
cd /usr/local/sbin
rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/mkwgetlauncher .
chmod 755 /usr/local/sbin/mkwgetlauncher
/usr/local/sbin/mkwgetlauncher
# Replication
cd /usr/local/sbin
rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/mkpushsiteconf .
chmod 755 /usr/local/sbin/mkpushsiteconf
/usr/local/sbin/mkpushsiteconf
touch $UPDDIR/CS-5
logger -t "$LOGTAG" "UPDATE CS-5 effectuee"
fi
###
############################################################################
### Mise a jour 1.3-15 - 09/12/2000
# Mise a jour du systeme rpm
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/1.3-15 \) ]
then
# Telechargement du RPM
cd /tmp
rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/rpm-3.0.5-9.5x.i386.rpm .
# Installation du RPM
rpm -U rpm-3.0.5-9.5x.i386.rpm
rpm --rebuilddb
# Verification et fin de la MAJ
rpm -q rpm-3.0.5-9.5x > /dev/null 2> /dev/null
if [ $? = 0 ]
then
touch $UPDDIR/1.3-15
logger -t "$LOGTAG" "Update 1.3-15 effectuee."
else
logger -t "$LOGTAG" "Update 1.3-15 ECHEC."
fi
fi
###
############################################################################
### Mise a jour 1.3-16 - 09/12/2000
# Install de postgres
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/1.3-16 \) ]
then
# Telechargement des RPMS
cd /tmp
rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/postgresql-7.0.3-2rh5x.i386.rpm .
rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/postgresql-server-7.0.3-2rh5x.i386.rpm .
# Installation des RPMS
rpm -U postgresql-7.0.3-2rh5x.i386.rpm
rpm -U postgresql-server-7.0.3-2rh5x.i386.rpm 2> /dev/null
/sbin/ldconfig
# Verification et fin de la MAJ
rpm -q postgresql-server-7.0.3-2 > /dev/null 2> /dev/null
if [ $? = 0 ]
then
touch $UPDDIR/1.3-16
logger -t "$LOGTAG" "Update 1.3-16 effectuee."
else
logger -t "$LOGTAG" "Update 1.3-16 ECHEC."
fi
fi
###
############################################################################
### Mise a jour 1.3-17 - 10/12/2000
# Install de php4+mod_php4+php-pgsql
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/1.3-17 \) ]
then
# Telechargement des RPMS
cd /tmp
rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/php-4.0.3pl1-1slis1x.i386.rpm .
rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/php-pgsql-4.0.3pl1-1slis1x.i386.rpm .
rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/mod_php-4.0.3pl1-1slis1x.i386.rpm .
# Installation des RPMS
rpm -U php-4.0.3pl1-1slis1x.i386.rpm
rpm -U php-pgsql-4.0.3pl1-1slis1x.i386.rpm
rpm -U mod_php-4.0.3pl1-1slis1x.i386.rpm
# Verification et fin de la MAJ
rpm -q php-pgsql-4.0.3pl1-1slis1x > /dev/null 2> /dev/null
RC1=$?
rpm -q mod_php-4.0.3pl1-1slis1x > /dev/null 2> /dev/null
if [ $? = 0 -a $RC1 = 0 ]
then
# Un php.ini specifique pour hadmin
sed "s/max_execution_time = 30/max_execution_time = 120/" /etc/php.ini > /etc/hadmin/php.ini
sed "s,/etc/hadmin/httpd -d /etc/hadmin 2> /tmp/herr,export PHPRC=\"/etc/hadmin\";/usr/sbin/httpd -f /etc/hadmin/conf/httpd.conf;export -n PHPRC," /etc/rc.d/rc.local > /tmp/rc.local
cp -f /etc/rc.d/rc.local /etc/rc.d/rc.local.upd-1.4-17
mv -f /tmp/rc.local /etc/rc.d/rc.local
chmod 755 /etc/rc.d/rc.local
# Activation du safe mode php dans le php.ini du httpd standard
sed "s/^safe_mode.*=.*Off/safe_mode = On/" /etc/php.ini > /tmp/php.ini
mv -f /tmp/php.ini /etc/php.ini
sed "s,safe_mode_exec_dir.*=.*,safe_mode_exec_dir = /usr/local/phpexec," /etc/php.ini > /tmp/php.ini
mv -f /tmp/php.ini /etc/php.ini
mkdir /usr/local/phpexec
# Flag de la MAJ
touch $UPDDIR/1.3-17
logger -t "$LOGTAG" "Update 1.3-17 effectuee."
else
logger -t "$LOGTAG" "Update 1.3-17 ECHEC."
fi
fi
###
############################################################################
### Mise a jour 1.3-18 - 10/12/2000
# MAJ d'apache
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/1.3-18 \) ]
then
# Telechargement des paquetages
cd /tmp
rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/apache-1.3.14-2.5.x.i386.rpm .
rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-1.x-18.tgz .
# Installation du RPM apache et de l'archive contenant la conf
/etc/rc.d/init.d/httpd stop
killall httpd
rpm -U apache-1.3.14-2.5.x.i386.rpm
cd /
tar zxf /tmp/upd-1.x-18.tgz
RC1=$?
# Remise en etat des droits au cas ou l'archive ne soit pas correcte
chown -R hadmin.hadmin /etc/hadmin
chmod -R 750 /etc/hadmin
chown -R nobody.nobody /etc/httpd
chmod -R 750 /etc/httpd
# Lien pour les modules (version slis < 2.0)
ln -fs /etc/httpd/modules/ /etc/hadmin/modules
# Redemarrage
/etc/rc.d/init.d/httpd start
export PHPRC="/etc/hadmin"
/usr/sbin/httpd -f /etc/hadmin/conf/httpd.conf
export -n PHPRC
# Verifications et fin de la MAJ
rpm -q apache-1.3.14-2.5.x > /dev/null 2> /dev/null
if [ $? = 0 -a $RC1 = 0 ]
then
touch $UPDDIR/1.3-18
logger -t "$LOGTAG" "Update 1.3-18 effectuee."
else
logger -t "$LOGTAG" "Update 1.3-18 ECHEC."
fi
fi
###
############################################################################
### Mise a jour CS-6 - 05/12/2000
# Initialisation de postgres
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/CS-6 \) ]
then
# Telechargement du tar
cd /tmp
rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-CS-6.tgz .
cd /
tar zxf /tmp/upd-CS-6.tgz
chmod 1777 /tmp
# mot de passe postgres
POSTGRESPASS=`$SLIS_BINDIR/pspg`
# mot de passe hadmin
ADMINPASS=`$SLIS_BINDIR/pspg`
# mot de passe slis
SLISPASS=`$SLIS_BINDIR/pspg`
# Stockage des mots de passe dans des fichiers de conf
# Fichier de conf pour le php de l'interface SLIS
echo "<?php" > /home/hadmin/html/config_pgsql.inc.php
echo "\$POSTGRESPASS=\"$POSTGRESPASS\";" >> /home/hadmin/html/config_pgsql.inc.php
echo "\$POSTGRESUSER=\"postgres\";" >> /home/hadmin/html/config_pgsql.inc.php
echo "\$ADMINPASS=\"$ADMINPASS\";" >> /home/hadmin/html/config_pgsql.inc.php
echo "\$ADMINUSER=\"hadmin\";" >> /home/hadmin/html/config_pgsql.inc.php
echo "\$SLISPASS=\"$SLISPASS\";" >> /home/hadmin/html/config_pgsql.inc.php
echo "\$SLISUSER=\"slis\";" >> /home/hadmin/html/config_pgsql.inc.php
echo "\$PGSQL_SERVER=\"127.0.0.1\";" >> /home/hadmin/html/config_pgsql.inc.php
echo "\$BASE_HADMIN=\"hadmin\";" >> /home/hadmin/html/config_pgsql.inc.php
echo "\$BASE_DHCP=\"dhcp\";" >> /home/hadmin/html/config_pgsql.inc.php
echo "\$BASE_SLIS=\"slis\";" >> /home/hadmin/html/config_pgsql.inc.php
echo "?>" >> /home/hadmin/html/config_pgsql.inc.php
# Fichier de conf pour perl
echo "\$POSTGRESPASS=\"$POSTGRESPASS\";" > /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
echo "\$POSTGRESUSER=\"postgres\";" >> /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
echo "\$ADMINPASS=\"$ADMINPASS\";" >> /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
echo "\$ADMINUSER=\"hadmin\";" >> /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
echo "\$SLISPASS=\"$SLISPASS\";" >> /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
echo "\$SLISUSER=\"slis\";" >> /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
echo "\$PGSQL_SERVER=\"127.0.0.1\";" >> /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
echo "\$BASE_HADMIN=\"hadmin\";" >> /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
echo "\$BASE_DHCP=\"dhcp\";" >> /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
echo "\$BASE_SLIS=\"slis\";" >> /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
# Fichier de conf pour le php des utilisateurs
echo "<?php" > /home/httpd/html/config_pgsql.inc.php
echo "\$PGSQL_PASS=\"$SLISPASS\";" >> /home/httpd/html/config_pgsql.inc.php
echo "\$PGSQL_USER=\"slis\";" >> /home/httpd/html/config_pgsql.inc.php
echo "\$PGSQL_SERVER=\"127.0.0.1\";" >> /home/httpd/html/config_pgsql.inc.php
echo "\$PGSQL_BASE=\"slis\";" >> /home/httpd/html/config_pgsql.inc.php
echo "?>" >> /home/httpd/html/config_pgsql.inc.php
# Securite sur ces fichiers de config
chmod 750 /home/hadmin/html/config_pgsql.inc.php
chown hadmin.hadmin /home/hadmin/html/config_pgsql.inc.php
chmod 750 /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
chown hadmin.hadmin /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
chmod 750 /home/httpd/html/config_pgsql.inc.php
chown nobody.nobody /home/httpd/html/config_pgsql.inc.php
# Premier demarrage de postgres
/etc/rc.d/init.d/postgresql start
# Config du boot
/sbin/chkconfig --add postgresql
# Appel du script d'init qui tourne sous postgres
su - postgres -c "$SLIS_BINDIR/init_pgsql.sh $POSTGRESPASS $ADMINPASS $SLISPASS> /dev/null"
rm -rf /tmp/dhcp.dump
touch $UPDDIR/CS-6
logger -t "$LOGTAG" "UPDATE CS-6 effectuee"
fi
###
############################################################################
### Mise a jour CS-7 - 05/12/2000
# Installation de l'interface d'administration dhcp
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/CS-7 \) ]
then
# Telechargement du tar
cd /tmp
rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-CS-7.tgz .
cd /
tar zxf /tmp/upd-CS-7.tgz
RC=$?
# Verification et fin de la MAJ
if [ $RC = 0 ]
then
touch $UPDDIR/CS-7
logger -t "$LOGTAG" "Update CS-7 effectuee."
else
logger -t "$LOGTAG" "Update CS-7 ECHEC."
fi
fi
###
############################################################################
### Mise a jour CS-8 - 07/12/2000
# Installation de phppgadmin
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/CS-8 \) ]
then
# Telechargement du tar
cd /tmp
rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-CS-8.tgz .
cd /
tar zxf /tmp/upd-CS-8.tgz
RC=$?
# Verification et fin de la MAJ
if [ $RC = 0 ]
then
touch $UPDDIR/CS-8
logger -t "$LOGTAG" "Update CS-8 effectuee."
else
logger -t "$LOGTAG" "Update CS-8 ECHEC."
fi
fi
###
############################################################################
### Mise a jour CS-9 - 07/12/2000
# Patch pour supprimmer postgres des users affich<E9>s
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/CS-9 \) ]
then
# Telechargement du tar
cd /tmp
rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-CS-9.tgz .
cd /
tar zxf /tmp/upd-CS-9.tgz
RC=$?
# Verification et fin de la MAJ
if [ $RC = 0 ]
then
touch $UPDDIR/CS-9
logger -t "$LOGTAG" "Update CS-9 effectuee."
else
logger -t "$LOGTAG" "Update CS-9 ECHEC."
fi
fi
###
############################################################################
### Mise a jour CS-10 - 12/12/2000
# MAJ de l'interface dhcp
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/CS-10 \) ]
then
# Telechargement du tar
cd /tmp
rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-CS-10.tgz .
cd /
tar zxf /tmp/upd-CS-10.tgz
RC=$?
# Verification et fin de la MAJ
if [ $RC = 0 ]
then
touch $UPDDIR/CS-10
logger -t "$LOGTAG" "Update CS-10 effectuee."
else
logger -t "$LOGTAG" "Update CS-10 ECHEC."
fi
fi
###
############################################################################
### Mise a jour 1.3-20 - 10/12/2000
# Conf de logrotate pour syslog
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/1.3-20 \) ]
then
echo "
/var/log/arpwatch {
postrotate
/usr/bin/killall -HUP syslogd
endscript
}
/var/log/slis {
postrotate
/usr/bin/killall -HUP syslogd
endscript
}
" >> /etc/logrotate.d/syslog
touch $UPDDIR/1.3-20
logger -t "$LOGTAG" "Update 1.3-20 effectuee."
fi
###
############################################################################
### Mise a jour 1.3-21 - 10/12/2000
# Nouveaux menus "fonction avancees"
# Rend obsolete : Les fichiers correspondant dans upd-CS-8.tgz
############################################################################
if [ ! \( -e $UPDDIR/1.3-21 \) ]
then
# Telechargement du tar
cd /tmp
rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-1.x-21.tgz .
cd /
tar zxf /tmp/upd-1.x-21.tgz
RC=$?
# Verification et fin de la MAJ
if [ $RC = 0 ]
then
touch $UPDDIR/1.3-21
logger -t "$LOGTAG" "Update 1.3-21 effectuee."
else
logger -t "$LOGTAG" "Update 1.3-21 ECHEC."
fi
fi
###
############################################################################
### Mise a jour CS-11 - 15/12/2000
# Patch de l'interface dhcp
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/CS-11 \) ]
then
# Telechargement du tar
cd /tmp
rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-CS-11.tgz .
cd /
tar zxf /tmp/upd-CS-11.tgz
RC=$?
# Verification et fin de la MAJ
if [ $RC = 0 ]
then
touch $UPDDIR/CS-11
logger -t "$LOGTAG" "Update CS-11 effectuee."
else
logger -t "$LOGTAG" "Update CS-11 ECHEC."
fi
fi
###
############################################################################
### Mise a jour 1.3-17b - 18/12/2000
# Bug de 1.3-17
# Rend obsolete : 1.3-17a
############################################################################
if [ ! \( -e $UPDDIR/1.3-17b \) ]
then
sed "s,/etc/hadmin/httpd -d /etc/hadmin 2> /tmp/herr,export PHPRC=\"/etc/hadmin\";/usr/sbin/httpd -f /etc/hadmin/conf/httpd.conf;export -n PHPRC," /etc/rc.d/rc.local > /tmp/rc.local
/etc/rc.d/init.d/httpd stop
killall httpd
rm -rf /var/lock/subsys/httpd
rm -rf /var/run/httpd.pid
rm -rf /var/run/httpd*lock*
sleep 6
/etc/rc.d/init.d/httpd start
export PHPRC="/etc/hadmin"
/usr/sbin/httpd -f /etc/hadmin/conf/httpd.conf
export -n PHPRC
touch $UPDDIR/1.3-17b
logger -t "$LOGTAG" "Update 1.3-17b effectuee."
fi
###
############################################################################
### Mise a jour 1.3-24b - 02/02/2001
# SECURITE BIND
# Rend obsolete : 1.3-24
############################################################################
if [ ! \( -e $UPDDIR/1.3-24b \) ]
then
cd /tmp
rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/bind-8.2.3-0.5.x.i386.rpm .
rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/bind-utils-8.2.3-0.5.x.i386.rpm .
rpm -U bind-8.2.3-0.5.x.i386.rpm
rpm -U bind-utils-8.2.3-0.5.x.i386.rpm
# Verifications
rpm -q bind-utils-8.2.3 2>/dev/null >/dev/null
RC=$?
rpm -q bind-8.2.3 2>/dev/null >/dev/null
if [ $? = 0 -a $RC = 0 ]
then
/etc/rc.d/init.d/named restart
sleep 2
touch $UPDDIR/1.3-24b
logger -t "$LOGTAG" "UPDATE 1.3-24b effectuee"
else
logger -t "$LOGTAG" "UPDATE 1.3-24b ECHEC."
fi
fi
###
############################################################################
### Mise a jour 1.3-26 - 29/01/2001
# Installation de xntpd
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/1.3-26 \) ]
then
cd /tmp
rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/xntp3-5.93-4.i386.rpm .
rpm -U xntp3-5.93-4.i386.rpm
# Verifications et fin de l'install
rpm -q xntp3-5.93-4 2>/dev/null >/dev/null
RC=$?
if [ $RC = 0 ]
then
chkconfig --add xntpd
/etc/rc.d/init.d/xntpd start
touch $UPDDIR/1.3-26
logger -t "$LOGTAG" "UPDATE 1.3-26 effectuee"
else
logger -t "$LOGTAG" "UPDATE 1.3-26 ECHEC."
fi
fi
###
############################################################################
### Mise a jour 1.x-27 - 30/01/2001
# Interface de configuration de l'onduleur
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/1.x-27 \) ]
then
# Si on ne tue pas mgeupsd, alors le tar va echouer
killall mgeupsd
# Telechargement du tar
cd /tmp
rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-1.x-27.tgz .
cd /
tar zxf /tmp/upd-1.x-27.tgz
RC=$?
# Verification et fin de la MAJ
if [ $RC = 0 ]
then
touch $UPDDIR/1.x-27
logger -t "$LOGTAG" "Update 1.x-27 effectuee."
else
logger -t "$LOGTAG" "Update 1.x-27 ECHEC."
fi
fi
###
############################################################################
### Mise a jour CS-12 - 01/02/2001
# Amelioration des fonctions de filtrage d'url
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/CS-12 \) ]
then
# Telechargement du tar
cd /tmp
rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-CS-12.tgz .
cd /
tar zxf /tmp/upd-CS-12.tgz
RC=$?
# Verification et fin de la MAJ
if [ $RC = 0 ]
then
touch $UPDDIR/CS-12
logger -t "$LOGTAG" "Update CS-12 effectuee."
else
logger -t "$LOGTAG" "Update CS-12 ECHEC."
fi
fi
###
############################################################################
### Mise a jour PQ - 05/04/2000
# Nouveau script /usr/local/sbin/process_queue
# Rend obsolete : 004-0 a 004-7 et PQ-1 PQ-2 PQ-3 PQ-4 PQ-5
# Si un nouveau process_queue est r<E9>alis<E9>, juste remplacer le numero de
# version et le fichier.
# ATTENTION: Laisser cette UPD en fin de fichier, avant les UPD KERNEL.
############################################################################
VERSION=7
DELAI=5 # Delai en minutes. C'est le temps estime que prendra l'execution de
# la fin de ce script plus une marge (install d'un nouveau slis)...
if [ ! \( -e $UPDDIR/PQ-$VERSION \) ]
then
PAS_UPD_KERNEL=1 # Empeche de faire une update du noyau
# Telechargement du nouveau fichier
cd /tmp
rsync rsync://$RSYNC/$MODULE/process_queue .
# slis_update est lance par process_queue, donc il faut faire attention
# a ne pas le remplacer tout de suite:
echo "mv -f /tmp/process_queue /usr/local/sbin/ ; chmod 700 /usr/local/sbin/process_queue" | at now + $DELAI minutes
touch $UPDDIR/PQ-$VERSION
logger -t "$LOGTAG" "UPDATE PQ-$VERSION effectuee."
fi
###
############################################################################
### Mise a jour NOTIFY - 29/04/99
# Notify
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/NOTIFY \) ]
then
echo "$HOSTNAME installe et MAJ" | mail -s "Nouveau SLIS 1.4" $SLISMASTER
sleep 2
/usr/lib/sendmail -q
killall crond
sleep 1
crond
touch $UPDDIR/NOTIFY
logger -t "$LOGTAG" "NOTIFY envoye."
fi
###
##############################
logger -t "$LOGTAG" "Script Version 1.3 Termine."
/bin/rm -rf /var/lock/slis_upd