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.4
< prev
next >
Wrap
Text File
|
2001-02-01
|
38KB
|
1,247 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.4
# 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.4 Debut."
############################################################################
### Mise a jour 124 - 09/03/2000
# Config du DNS en forwarder
# Rend obsolete : Tout ce qui remplacait /etc/named.conf
############################################################################
if [ ! \( -e $UPDDIR/124 \) ]
then
cd /usr/local/sbin
rsync rsync://$RSYNC/$MODULE/mknamedconf .
chmod 755 mknamedconf
cp -f /etc/named.conf /etc/named.conf.bak
/usr/local/sbin/mknamedconf > /etc/named.conf
/etc/rc.d/init.d/named restart
touch $UPDDIR/124
logger -t "$LOGTAG" "UPDATE 124"
fi
###
############################################################################
### Mise a jour 125 - 10/03/2000
# Nouveau users_pop.cgi (gΘnΘration des utilisateurs)
# les mots de passe gΘnΘrΘs sont maintenant en minuscules a cause
# des clients windows qui ne differencient pas min/maj p/rapport α samba.
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/125 \) ]
then
cd /home/hadmin/cgi-bin
rsync rsync://$RSYNC/$MODULE/users_pop.cgi .
chmod 755 users_pop.cgi
touch $UPDDIR/125
logger -t "$LOGTAG" "UPDATE 125"
fi
###
# Update 126 uniquement sur les SLIS 1.3 de Grenoble
############################################################################
### Mise a jour 127 - 17/03/2000
# Nouveau sendmail.cf
# Sendmail essayait de resoudre les noms DNS des destinataires plutot que
# de se contenter de relayer sans questions au smarthost.
# Resultat, la ligne pouvait rester ouverte 24h/24 ` cause d'un message
# vers un domaine inconnu!
# Les options ServiceSwitchFile et HostsFile ont iti activies.
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/127 \) ]
then
# La mise ` jour n'est utile que pour les SLIS en liaison numeris
# et pas pour ceux qui ont une liaison permanente
if [ ! \( -e /etc/ls \) ]
then
cd /etc
cp -f sendmail.cf sendmail.cf.bak
rsync rsync://$RSYNC/$MODULE/sendmail.cf .
/etc/rc.d/init.d/sendmail stop
sleep 2
/etc/rc.d/init.d/sendmail start
# On prend le risque que des messages soient perdus, mais on les backup
# tout de meme:
mkdir /root/mqueue_bak
mv -f /var/spool/mqueue/* /root/mqueue_bak
fi
touch $UPDDIR/127
logger -t "$LOGTAG" "UPDATE 127 effectuee."
fi
###
############################################################################
### Mise a jour 128-squid - 28/03/2000
# Nouvelle version de Squid (2.3STABLE2)
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/128-squid \) ]
then
count=0
killall RunCache
killall squid
while [ "`ps awux |grep -i squid |grep -v grep`" \!= "" -a $count -lt 120 ]
do
count=`expr $count + 1`
sleep 1
done
cd /tmp
rsync rsync://$RSYNC/$MODULE/upd-128-squid.tgz .
cd /
tar zxf /tmp/upd-128-squid.tgz
ln -s /usr/local/sbin/remplace /usr/local/bin/remplace
/usr/local/sbin/mksquidconf
nohup su - nobody -c /usr/local/squid/bin/RunCache&
rm -rf /tmp/upd-128-squid.tgz
touch $UPDDIR/128-squid
logger -t "$LOGTAG" "UPDATE 128-squid effectuee."
fi
###
############################################################################
### Mise a jour 129 - 30/03/2000
# Ajout de squidGuard et scripts de l'interface qui vont avec
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/129 \) ]
then
cd /tmp
rsync rsync://$RSYNC/$MODULE/upd-129.tgz .
cd /
tar zxf /tmp/upd-129.tgz
/usr/local/sbin/mksquidconf
/usr/local/sbin/mksquidguardconf
touch $UPDDIR/129
logger -t "$LOGTAG" "UPDATE 129 effectuee."
fi
###
############################################################################
### Mise a jour 128c - 04/07/2000
# Un squid.conf different pour mes SLIS non standards
# Attention: doit etre faite apres la 129!!
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/128c \) ]
then
if [ $HOSTNAME = "cddp73.ac-grenoble.fr" \
-o "$HOSTNAME" = "cddp73.ac-grenoble.fr" \
-o "$HOSTNAME" = "lyc-boissy-anglas.ac-grenoble.fr" \
-o "$HOSTNAME" = "lyc-cheylard.ac-grenoble.fr" \
-o "$HOSTNAME" = "lyc-victor-hugo.ac-grenoble.fr" \
-o "$HOSTNAME" = "michelet-valence.ac-grenoble.fr" \
-o "$HOSTNAME" = "pablo-picasso.ac-grenoble.fr" \
-o "$HOSTNAME" = "clg-fantin-latour.ac-grenoble.fr" \
-o "$HOSTNAME" = "berges.ac-grenoble.fr" \
]
then
logger -t "$LOGTAG" "UPDATE 128b: install du squid.conf non std"
cd /tmp
rsync rsync://$RSYNC/$MODULE/upd-128c.tgz .
cd /
cp -f /usr/local/squid/etc/squid.conf.slis /usr/local/squid/etc/squid.conf.slis.128c
tar zxf /tmp/upd-128c.tgz
/usr/local/sbin/mksquidconf
killall -HUP squid
rm -rf /tmp/upd-128c.tgz
else
logger -t "$LOGTAG" "UPDATE 128c: squid.conf OK. Pas de modif."
fi
touch $UPDDIR/128c
logger -t "$LOGTAG" "UPDATE 128c effectuee."
fi
###
############################################################################
### Mise a jour 129a - 10/06/2000
# Premiere MAJ des bases squidguard
# Les autres se feront hebdomadairement par le script commun
############################################################################
if [ ! \( -s /usr/local/squid/squidGuard/db/adult/domains \) -a \
! \( -e $UPDDIR/129a \) ]
then
logger -t "$LOGTAG" "RECUPERATION BASES FILTRES URL: debut"
cd /usr/local/squid/squidGuard/db
rsync rsync://$RSYNC/slis-updates/adult.tar.gz .
rsync rsync://$RSYNC/slis-updates/warez.tar.gz .
rsync rsync://$RSYNC/slis-updates/forums.tar.gz .
rsync rsync://$RSYNC/slis-updates/publicite.tar.gz .
rsync rsync://$RSYNC/slis-updates/academie.tar.gz .
logger -t "$LOGTAG" "Installation des bases."
tar zxf adult.tar.gz
tar zxf warez.tar.gz
tar zxf forums.tar.gz
tar zxf publicite.tar.gz
tar zxf academie.tar.gz
chown -R nobody.nobody *
/usr/local/squid/bin/squidGuard -C /usr/local/squid/squidGuard/db/adult/domains
/usr/local/squid/bin/squidGuard -C /usr/local/squid/squidGuard/db/adult/urls
/usr/local/squid/bin/squidGuard -C /usr/local/squid/squidGuard/db/warez/domains
/usr/local/squid/bin/squidGuard -C /usr/local/squid/squidGuard/db/warez/urls
/usr/local/squid/bin/squidGuard -C /usr/local/squid/squidGuard/db/forums/domains
/usr/local/squid/bin/squidGuard -C /usr/local/squid/squidGuard/db/forums/urls
/usr/local/squid/bin/squidGuard -C /usr/local/squid/squidGuard/db/publicite/domains
/usr/local/squid/bin/squidGuard -C /usr/local/squid/squidGuard/db/publicite/urls
/usr/local/squid/bin/squidGuard -C /usr/local/squid/squidGuard/db/academie/domains
/usr/local/squid/bin/squidGuard -C /usr/local/squid/squidGuard/db/academie/urls
logger -t "$LOGTAG" "Redemarrage du cache."
killall -HUP squid
logger -t "$LOGTAG" "RECUPERATION BASES FILTRES URL: fin"
touch $UPDDIR/129a
fi
###
############################################################################
### Mise a jour 130 - 04/04/2000
# Ajout du script de conf automatique proxy slis.pac
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/130 \) ]
then
cd /tmp
rsync rsync://$RSYNC/$MODULE/upd-130.tgz .
cd /
tar zxf /tmp/upd-130.tgz
# Simple precaution:
chmod 755 /home/httpd/cgi-bin/slis.pac
chmod 755 /home/hadmin
chmod 755 /home/hadmin/slis.conf.pl
# prise en compte du nouveau /etc/mime.types
killall -HUP httpd
touch $UPDDIR/130
logger -t "$LOGTAG" "UPDATE 130 effectuee."
fi
###
############################################################################
### Mise a jour 131 - 11/04/2000
# Ajout d'un rm /var/lock/*slis* dans /etc/rc.d
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/131 \) ]
then
echo "rm -rf /var/lock/*slis*" > /etc/rc.d/rc3.d/S09purge_lock
chmod 755 /etc/rc.d/rc3.d/S09purge_lock
touch $UPDDIR/131
logger -t "$LOGTAG" "UPDATE 131 effectuee."
fi
###
############################################################################
### Mise a jour 132 - 17/04/2000
# ImplΘmentation des ACLS bind dans la gestion des sous-reseaux
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/132c \) ]
then
cd /tmp
rsync rsync://$RSYNC/$MODULE/upd-132.tgz .
cd /
tar zxf /tmp/upd-132.tgz
cp -f /etc/named.conf /etc/named.conf.132
/usr/local/sbin/mknamedconf > /etc/named.conf
/usr/local/sbin/mknamedacls
touch $UPDDIR/132c
logger -t "$LOGTAG" "UPDATE 132 effectuee."
fi
###
############################################################################
### Mise a jour 133 - 17/04/2000
# Sendmail tombΘ. Bug MAJ 127??
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/133 \) ]
then
if [ "`ps awux |grep sendmail|grep -v grep`" = "" ]
then
/etc/rc.d/init.d/sendmail start
fi
touch $UPDDIR/133
logger -t "$LOGTAG" "UPDATE 133 effectuee."
fi
###
############################################################################
### 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.4-6 - 31/08/2000
# Update securite makewhatis
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/1.4-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.4-6
logger -t "$LOGTAG" "Update 1.4-6 effectuee."
fi
###
############################################################################
### Mise a jour 1.4-7 - 18/09/2000
# Update securite portmap (sunrpc udp/tcp 111)
# Arret et suppression de portmap
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/1.4-7 \) ]
then
/etc/rc.d/init.d/portmap stop
rpm -e yp-tools
rpm -e ypbind
rpm -e portmap
touch $UPDDIR/1.4-7
logger -t "$LOGTAG" "Update 1.4-7 effectuee."
fi
###
############################################################################
### Mise a jour 1.4-8b - 27/09/2000
# Nouvelle fonction: aspiration de sites
# Rend obsolete : 1.4-8
############################################################################
if [ ! \( -e $UPDDIR/1.4-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.4-8b
logger -t "$LOGTAG" "Update 1.4-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,CS-1
############################################################################
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.4-10 - 02/10/2000
# Update securite syslog
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/1.4-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.4-10
logger -t "$LOGTAG" "Update 1.4-10 effectuee."
fi
###
############################################################################
### Mise a jour 1.4-11 - 09/10/2000
# Ajout du code mime de shockwave
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/1.4-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.4-11
logger -t "$LOGTAG" "Update 1.4-11 effectuee."
fi
###
############################################################################
### Mise a jour 1.4-13 - 22/10/2000
# Nouveau binaire sendmail et nouvelle conf avec anti-spam
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/1.4-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.4-13
logger -t "$LOGTAG" "Update 1.4-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.4-15 - 09/12/2000
# Mise a jour du systeme rpm
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/1.4-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.4-15
logger -t "$LOGTAG" "Update 1.4-15 effectuee."
else
logger -t "$LOGTAG" "Update 1.4-15 ECHEC."
fi
fi
###
############################################################################
### Mise a jour 1.4-16 - 09/12/2000
# Install de postgres
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/1.4-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.4-16
logger -t "$LOGTAG" "Update 1.4-16 effectuee."
else
logger -t "$LOGTAG" "Update 1.4-16 ECHEC."
fi
fi
###
############################################################################
### Mise a jour 1.4-17 - 10/12/2000
# Install de php4+mod_php4+php-pgsql
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/1.4-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.4-17
logger -t "$LOGTAG" "Update 1.4-17 effectuee."
else
logger -t "$LOGTAG" "Update 1.4-17 ECHEC."
fi
fi
###
############################################################################
### Mise a jour 1.4-18 - 10/12/2000
# MAJ d'apache
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/1.4-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.4-18
logger -t "$LOGTAG" "Update 1.4-18 effectuee."
else
logger -t "$LOGTAG" "Update 1.4-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.4-20 - 10/12/2000
# Conf de logrotate pour syslog
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/1.4-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.4-20
logger -t "$LOGTAG" "Update 1.4-20 effectuee."
fi
###
############################################################################
### Mise a jour 1.4-21 - 10/12/2000
# Nouveaux menus "fonction avancees"
# Rend obsolete : Les fichiers correspondant dans upd-CS-8.tgz
############################################################################
if [ ! \( -e $UPDDIR/1.4-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.4-21
logger -t "$LOGTAG" "Update 1.4-21 effectuee."
else
logger -t "$LOGTAG" "Update 1.4-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.4-17b - 15/12/2000
# Bug de 1.4-17
# Rend obsolete : 1.3-17a
############################################################################
if [ ! \( -e $UPDDIR/1.4-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.4-17b
logger -t "$LOGTAG" "Update 1.4-17b effectuee."
fi
###
############################################################################
### Mise a jour 1.4-24b - 02/02/2001
# SECURITE BIND
# Rend obsolete : 1.4-24
############################################################################
if [ ! \( -e $UPDDIR/1.4-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
touch $UPDDIR/1.4-24b
logger -t "$LOGTAG" "UPDATE 1.4-24b effectuee"
else
logger -t "$LOGTAG" "UPDATE 1.4-24b ECHEC."
fi
fi
###
############################################################################
### Mise a jour 1.4-26 - 29/01/2001
# Installation de xntpd
# Rend obsolete :
############################################################################
if [ ! \( -e $UPDDIR/1.4-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.4-26
logger -t "$LOGTAG" "UPDATE 1.4-26 effectuee"
else
logger -t "$LOGTAG" "UPDATE 1.4-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ΘalisΘ, 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.4 Termine."
/bin/rm -rf /var/lock/slis_upd