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 >
Text File  |  2001-02-01  |  38KB  |  1,247 lines

  1. #!/bin/bash
  2.  
  3. # Script de mise α jour tΘlΘchargΘ rΘguliΦrement par rsync par tous les
  4. # serveurs SLIS dans les Θtablissements. 
  5.  
  6. # Script pour les SLIS version 1.4
  7. # Ce script est une conversion du script destine a l'ancien systeme (tftp)
  8. # jusqu'a la MAJ 136
  9.  
  10. # This script is part of the SLIS Project initiated by the CARMI-Internet
  11. # (AcadΘmie de Grenoble - France 38).
  12. # Ce script fait partie du projet SLIS dΘmarrΘ par le CARMI-Internet
  13. # (AcadΘmie de Grenoble - France 38).
  14. #
  15. # SLIS : Serveur de communications Linux pour l'Internet Scolaire.
  16. # Copyright (C) 1998-2000 Bruno Bzeznik
  17. #
  18. #    This program is free software; you can redistribute it and/or modify
  19. #    it under the terms of the GNU General Public License as published by
  20. #    the Free Software Foundation; either version 2 of the License, or
  21. #    (at your option) any later version.
  22. #
  23. #    This program is distributed in the hope that it will be useful,
  24. #    but WITHOUT ANY WARRANTY; without even the implied warranty of
  25. #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  26. #    GNU General Public License for more details.
  27. #    You should have received a copy of the GNU General Public License
  28. #    along with this program (For example ./COPYING);
  29. #    if not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  30. #    Cambridge, MA 02139, USA.
  31. #
  32. # Please send all comments and bug reports by electronic mail to:
  33. #   Bruno Bzeznik <Bruno@ac-grenoble.fr>
  34. # or to <slis@ac-grenoble.fr>
  35. #
  36. # Envoyez vos suggestions et reports de bugs par e-mail α
  37. #   Bruno Bzeznik <Bruno@ac-grenoble.fr>
  38. # ou α <slis@ac-grenoble.fr>
  39. #
  40.  
  41. ### VARIABLES ###
  42. UPDDIR=/home/hadmin/updates # Rep pour les flags
  43. LOGTAG="slis_update[$$]" # Ce qui apparait en syslog
  44. PAS_UPD_KERNEL=0        # Si ce flag est a un, alors la mise a jour du noyau
  45.                 # (qui necessite reboot) ne sera pas faite cette fois.
  46. # Recuperation de la variable HOSTNAME :
  47. grep HOSTNAME /etc/sysconfig/network > /tmp/hostname
  48. . /tmp/hostname
  49. rm -rf /tmp/hostname
  50.  
  51. QUEUE=/home/hadmin/cgi-bin/queue     # File d'attente SLIS
  52. BASE=/home/hadmin/cgi-bin/base        # Base SLIS
  53. BINDIR=/usr/local/sbin            # Scripts et binaires SLIS
  54. ACAD_DOMAIN=ac-grenoble.fr        # Domaine
  55. MAILSERVER=pluton            # Serveur de messagerie du domaine (nom sans le domaine)
  56. IPMAILSERVER=193.54.149.10        # Adresse ip du serveur de messagerie
  57. TFTP=pluton.ac-grenoble.fr        # Serveur tftp des mises α jour (obsolete)
  58. RSYNC=pluton.ac-grenoble.fr        # Serveur rsync des mises α jour
  59. MODULE=slis-updates                     # Module rsync du serveur des mises α jour
  60. FTP=ftp.ac-grenoble.fr            # Serveur anonyme de mises α jour RedHat
  61. TIME=pluton.ac-grenoble.fr        # Serveur d'heure
  62. SLISMASTER=Bruno@ac-grenoble.fr        # Administrateur acadΘmique SLIS
  63. WEBMASTER=`ls -ld /home/httpd/html |awk '{print $3}'` # Webmaster designΘ par l'admin local
  64.  
  65. . /home/hadmin/slis.conf
  66.  
  67. ##################
  68.  
  69. # Gestion d'un lock
  70. if [ -e /var/lock/slis_upd ]
  71. then 
  72.   logger -t "$LOGTAG" "Deja en cours. Abandon."
  73.   exit
  74. fi
  75. touch /var/lock/slis_upd
  76. sleep 1
  77.  
  78. logger -t "$LOGTAG" "Script Version 1.4 Debut."
  79.  
  80.  
  81. ############################################################################
  82. ### Mise a jour 124 - 09/03/2000
  83. # Config du DNS en forwarder
  84. # Rend obsolete : Tout ce qui remplacait /etc/named.conf
  85. ############################################################################
  86.  
  87. if [ ! \( -e $UPDDIR/124 \) ]
  88. then
  89.   cd /usr/local/sbin
  90.   rsync rsync://$RSYNC/$MODULE/mknamedconf .
  91.   chmod 755 mknamedconf
  92.   cp -f /etc/named.conf /etc/named.conf.bak
  93.   /usr/local/sbin/mknamedconf > /etc/named.conf
  94.   /etc/rc.d/init.d/named restart
  95.  
  96.   touch $UPDDIR/124
  97.   logger -t "$LOGTAG" "UPDATE 124"
  98. fi
  99. ###
  100.  
  101. ############################################################################
  102. ### Mise a jour 125 - 10/03/2000
  103. # Nouveau users_pop.cgi (gΘnΘration des utilisateurs)
  104. # les mots de passe gΘnΘrΘs sont maintenant en minuscules a cause
  105. # des clients windows qui ne differencient pas min/maj p/rapport α samba.
  106. # Rend obsolete :
  107. ############################################################################
  108.  
  109. if [ ! \( -e $UPDDIR/125 \) ]
  110. then
  111.   cd /home/hadmin/cgi-bin
  112.   rsync rsync://$RSYNC/$MODULE/users_pop.cgi .
  113.   chmod 755 users_pop.cgi
  114.  
  115.   touch $UPDDIR/125
  116.   logger -t "$LOGTAG" "UPDATE 125"
  117. fi
  118. ###
  119.  
  120. # Update 126 uniquement sur les SLIS 1.3 de Grenoble
  121.  
  122. ############################################################################
  123. ### Mise a jour 127 - 17/03/2000   
  124. # Nouveau sendmail.cf
  125. # Sendmail essayait de resoudre les noms DNS des destinataires plutot que
  126. # de se contenter de relayer sans questions au smarthost.
  127. # Resultat, la ligne pouvait rester ouverte 24h/24 ` cause d'un message
  128. # vers un domaine inconnu!
  129. # Les options ServiceSwitchFile et HostsFile ont iti activies.
  130. # Rend obsolete :  
  131. ############################################################################
  132.   
  133. if [ ! \( -e $UPDDIR/127 \) ]
  134. then
  135.  
  136.   # La mise ` jour n'est utile que pour les SLIS en liaison numeris
  137.   # et pas pour ceux qui ont une liaison permanente
  138.   if [ ! \( -e /etc/ls \) ]
  139.   then
  140.     cd /etc
  141.     cp -f sendmail.cf sendmail.cf.bak
  142.     rsync rsync://$RSYNC/$MODULE/sendmail.cf .
  143.     /etc/rc.d/init.d/sendmail stop
  144.     sleep 2
  145.     /etc/rc.d/init.d/sendmail start
  146.     # On prend le risque que des messages soient perdus, mais on les backup
  147.     # tout de meme:
  148.     mkdir /root/mqueue_bak
  149.     mv -f /var/spool/mqueue/* /root/mqueue_bak
  150.   fi
  151.  
  152.   touch $UPDDIR/127
  153.   logger -t "$LOGTAG" "UPDATE 127 effectuee."
  154. fi
  155. ###
  156.  
  157. ############################################################################
  158. ### Mise a jour 128-squid - 28/03/2000
  159. # Nouvelle version de Squid (2.3STABLE2)
  160. # Rend obsolete :
  161. ############################################################################
  162.  
  163. if [ ! \( -e $UPDDIR/128-squid \) ]
  164. then
  165.   count=0
  166.   killall RunCache
  167.   killall squid
  168.   while [ "`ps awux |grep -i squid |grep -v grep`" \!= "" -a $count -lt 120 ]
  169.   do
  170.     count=`expr $count + 1`
  171.     sleep 1
  172.   done
  173.   cd /tmp
  174.   rsync rsync://$RSYNC/$MODULE/upd-128-squid.tgz .
  175.   cd /
  176.   tar zxf /tmp/upd-128-squid.tgz
  177.   ln -s /usr/local/sbin/remplace /usr/local/bin/remplace
  178.   /usr/local/sbin/mksquidconf
  179.   nohup su - nobody -c /usr/local/squid/bin/RunCache&
  180.   rm -rf /tmp/upd-128-squid.tgz
  181.  
  182.   touch $UPDDIR/128-squid
  183.   logger -t "$LOGTAG" "UPDATE 128-squid effectuee."
  184. fi
  185. ###
  186.  
  187. ############################################################################
  188. ### Mise a jour 129 - 30/03/2000
  189. # Ajout de squidGuard et scripts de l'interface qui vont avec
  190. # Rend obsolete :
  191. ############################################################################
  192.  
  193. if [ ! \( -e $UPDDIR/129 \) ]
  194. then
  195.   cd /tmp
  196.   rsync rsync://$RSYNC/$MODULE/upd-129.tgz .
  197.   cd /
  198.   tar zxf /tmp/upd-129.tgz
  199.   /usr/local/sbin/mksquidconf
  200.   /usr/local/sbin/mksquidguardconf
  201.  
  202.   touch $UPDDIR/129
  203.   logger -t "$LOGTAG" "UPDATE 129 effectuee."
  204. fi
  205. ###
  206.  
  207. ############################################################################
  208. ### Mise a jour 128c - 04/07/2000
  209. # Un squid.conf different pour mes SLIS non standards
  210. # Attention: doit etre faite apres la 129!!
  211. # Rend obsolete :
  212. ############################################################################
  213.  
  214. if [ ! \( -e $UPDDIR/128c \) ]
  215. then
  216.   if [ $HOSTNAME = "cddp73.ac-grenoble.fr" \
  217.         -o "$HOSTNAME" = "cddp73.ac-grenoble.fr" \
  218.         -o "$HOSTNAME" = "lyc-boissy-anglas.ac-grenoble.fr" \
  219.         -o "$HOSTNAME" = "lyc-cheylard.ac-grenoble.fr" \
  220.         -o "$HOSTNAME" = "lyc-victor-hugo.ac-grenoble.fr" \
  221.         -o "$HOSTNAME" = "michelet-valence.ac-grenoble.fr" \
  222.         -o "$HOSTNAME" = "pablo-picasso.ac-grenoble.fr" \
  223.         -o "$HOSTNAME" = "clg-fantin-latour.ac-grenoble.fr" \
  224.         -o "$HOSTNAME" = "berges.ac-grenoble.fr" \
  225.   ]
  226.   then
  227.     logger -t "$LOGTAG" "UPDATE 128b: install du squid.conf non std"
  228.     cd /tmp
  229.     rsync rsync://$RSYNC/$MODULE/upd-128c.tgz .
  230.  
  231.     cd /
  232.     cp -f /usr/local/squid/etc/squid.conf.slis /usr/local/squid/etc/squid.conf.slis.128c
  233.     tar zxf /tmp/upd-128c.tgz
  234.     /usr/local/sbin/mksquidconf
  235.     killall -HUP squid
  236.     rm -rf /tmp/upd-128c.tgz
  237.   else
  238.     logger -t "$LOGTAG" "UPDATE 128c: squid.conf OK. Pas de modif."
  239.   fi
  240.  
  241.   touch $UPDDIR/128c
  242.   logger -t "$LOGTAG" "UPDATE 128c effectuee."
  243. fi
  244. ###
  245.  
  246. ############################################################################
  247. ### Mise a jour 129a - 10/06/2000
  248. # Premiere MAJ des bases squidguard
  249. # Les autres se feront hebdomadairement par le script commun
  250. ############################################################################
  251. if [ ! \( -s /usr/local/squid/squidGuard/db/adult/domains \) -a \
  252.      ! \( -e $UPDDIR/129a \) ]
  253. then
  254.   logger -t "$LOGTAG" "RECUPERATION BASES FILTRES URL: debut"
  255.   cd /usr/local/squid/squidGuard/db
  256.   rsync rsync://$RSYNC/slis-updates/adult.tar.gz .
  257.   rsync rsync://$RSYNC/slis-updates/warez.tar.gz .
  258.   rsync rsync://$RSYNC/slis-updates/forums.tar.gz .
  259.   rsync rsync://$RSYNC/slis-updates/publicite.tar.gz .
  260.   rsync rsync://$RSYNC/slis-updates/academie.tar.gz .
  261.   logger -t "$LOGTAG" "Installation des bases."
  262.   tar zxf adult.tar.gz
  263.   tar zxf warez.tar.gz
  264.   tar zxf forums.tar.gz
  265.   tar zxf publicite.tar.gz
  266.   tar zxf academie.tar.gz
  267.   chown -R nobody.nobody *
  268.   /usr/local/squid/bin/squidGuard -C /usr/local/squid/squidGuard/db/adult/domains
  269.   /usr/local/squid/bin/squidGuard -C /usr/local/squid/squidGuard/db/adult/urls
  270.   /usr/local/squid/bin/squidGuard -C /usr/local/squid/squidGuard/db/warez/domains
  271.   /usr/local/squid/bin/squidGuard -C /usr/local/squid/squidGuard/db/warez/urls
  272.   /usr/local/squid/bin/squidGuard -C /usr/local/squid/squidGuard/db/forums/domains
  273.   /usr/local/squid/bin/squidGuard -C /usr/local/squid/squidGuard/db/forums/urls
  274.   /usr/local/squid/bin/squidGuard -C /usr/local/squid/squidGuard/db/publicite/domains
  275.   /usr/local/squid/bin/squidGuard -C /usr/local/squid/squidGuard/db/publicite/urls
  276.   /usr/local/squid/bin/squidGuard -C /usr/local/squid/squidGuard/db/academie/domains
  277.   /usr/local/squid/bin/squidGuard -C /usr/local/squid/squidGuard/db/academie/urls
  278.   logger -t "$LOGTAG" "Redemarrage du cache."
  279.   killall -HUP squid
  280.   logger -t "$LOGTAG" "RECUPERATION BASES FILTRES URL: fin"
  281.   touch $UPDDIR/129a
  282. fi
  283. ###
  284.  
  285. ############################################################################
  286. ### Mise a jour 130 - 04/04/2000
  287. # Ajout du script de conf automatique proxy slis.pac
  288. # Rend obsolete :
  289. ############################################################################
  290.  
  291. if [ ! \( -e $UPDDIR/130 \) ]
  292. then
  293.   cd /tmp
  294.   rsync rsync://$RSYNC/$MODULE/upd-130.tgz .
  295.   cd /
  296.   tar zxf /tmp/upd-130.tgz
  297.   # Simple precaution:
  298.   chmod 755 /home/httpd/cgi-bin/slis.pac
  299.   chmod 755 /home/hadmin
  300.   chmod 755 /home/hadmin/slis.conf.pl
  301.   # prise en compte du nouveau /etc/mime.types
  302.   killall -HUP httpd
  303.  
  304.   touch $UPDDIR/130
  305.   logger -t "$LOGTAG" "UPDATE 130 effectuee."
  306. fi
  307. ###
  308.  
  309. ############################################################################
  310. ### Mise a jour 131 - 11/04/2000
  311. # Ajout d'un rm /var/lock/*slis* dans /etc/rc.d
  312. # Rend obsolete :
  313. ############################################################################
  314.  
  315. if [ ! \( -e $UPDDIR/131 \) ]
  316. then
  317.   echo "rm -rf /var/lock/*slis*" > /etc/rc.d/rc3.d/S09purge_lock
  318.   chmod 755 /etc/rc.d/rc3.d/S09purge_lock
  319.  
  320.   touch $UPDDIR/131
  321.   logger -t "$LOGTAG" "UPDATE 131 effectuee."
  322. fi
  323. ###
  324.  
  325. ############################################################################
  326. ### Mise a jour 132 - 17/04/2000
  327. # ImplΘmentation des ACLS bind dans la gestion des sous-reseaux
  328. # Rend obsolete :
  329. ############################################################################
  330.  
  331. if [ ! \( -e $UPDDIR/132c \) ]
  332. then
  333.   cd /tmp
  334.   rsync rsync://$RSYNC/$MODULE/upd-132.tgz .
  335.   cd /
  336.   tar zxf /tmp/upd-132.tgz
  337.   cp -f /etc/named.conf /etc/named.conf.132
  338.   /usr/local/sbin/mknamedconf > /etc/named.conf
  339.   /usr/local/sbin/mknamedacls
  340.  
  341.   touch $UPDDIR/132c
  342.   logger -t "$LOGTAG" "UPDATE 132 effectuee."
  343. fi
  344. ###
  345.  
  346. ############################################################################
  347. ### Mise a jour 133 - 17/04/2000
  348. # Sendmail tombΘ. Bug MAJ 127??
  349. # Rend obsolete :
  350. ############################################################################
  351.  
  352. if [ ! \( -e $UPDDIR/133 \) ]
  353. then
  354.  
  355.   if [ "`ps awux |grep sendmail|grep -v grep`" = "" ]
  356.   then
  357.     /etc/rc.d/init.d/sendmail start
  358.   fi
  359.  
  360.   touch $UPDDIR/133
  361.   logger -t "$LOGTAG" "UPDATE 133 effectuee."
  362. fi
  363. ###
  364.  
  365. ############################################################################
  366. ### Mise a jour 137 - 04/07/2000
  367. # Update securite wu_ftpd
  368. # Rend obsolete :
  369. ############################################################################
  370.  
  371. if [ ! \( -e $UPDDIR/137 \) ]
  372. then
  373.  
  374.   cd /tmp
  375.   rsync rsync://$RSYNC/$MODULE/wu-ftpd-2.6.0-2.5.x.i386.rpm .
  376.   rpm -U ./wu-ftpd-2.6.0-2.5.x.i386.rpm
  377.  
  378.   touch $UPDDIR/137
  379.   logger -t "$LOGTAG" "Update 137 effectuee."
  380. fi
  381. ###
  382.  
  383. ############################################################################
  384. ### Mise a jour 1.4-6 - 31/08/2000
  385. # Update securite makewhatis
  386. # Rend obsolete :
  387. ############################################################################
  388.  
  389. if [ ! \( -e $UPDDIR/1.4-6 \) ]
  390. then
  391.  
  392.   cd /tmp
  393.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/man-1.5h1-2.5.x.i386.rpm .
  394.   rpm -U ./man-1.5h1-2.5.x.i386.rpm
  395.  
  396.   touch $UPDDIR/1.4-6
  397.   logger -t "$LOGTAG" "Update 1.4-6 effectuee."
  398. fi
  399. ###
  400.  
  401. ############################################################################
  402. ### Mise a jour 1.4-7 - 18/09/2000
  403. # Update securite portmap (sunrpc udp/tcp 111)
  404. # Arret et suppression de portmap
  405. # Rend obsolete :
  406. ############################################################################
  407.  
  408. if [ ! \( -e $UPDDIR/1.4-7 \) ]
  409. then
  410.  
  411.   /etc/rc.d/init.d/portmap stop
  412.   rpm -e yp-tools
  413.   rpm -e ypbind
  414.   rpm -e portmap
  415.  
  416.   touch $UPDDIR/1.4-7
  417.   logger -t "$LOGTAG" "Update 1.4-7 effectuee."
  418. fi
  419. ###
  420.  
  421. ############################################################################
  422. ### Mise a jour 1.4-8b - 27/09/2000
  423. # Nouvelle fonction: aspiration de sites
  424. # Rend obsolete : 1.4-8
  425. ############################################################################
  426.  
  427. if [ ! \( -e $UPDDIR/1.4-8b \) ]
  428. then
  429.  
  430.   cd /tmp
  431.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/wget-1.5.3-2.i386.rpm .
  432.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-web-get.tgz .
  433.   rpm -U ./wget-1.5.3-2.i386.rpm
  434.   cd /
  435.   tar zxf /tmp/upd-web-get.tgz
  436.   $SLIS_BINDIR/mkwgetlauncher
  437.  
  438.   touch $UPDDIR/1.4-8b
  439.   logger -t "$LOGTAG" "Update 1.4-8b effectuee."
  440. fi
  441. ###
  442.  
  443. ############################################################################
  444. ### Mise a jour CS-1b - 28/09/2000
  445. # Ameliorations fonction aspiration de sites
  446. # Rend obsolete : 2.0-9,2.0-9b,2.0-9c,CS-1
  447. ############################################################################
  448.  
  449. if [ ! \( -e $UPDDIR/CS-1b \) ]
  450. then
  451.  
  452.   cd /tmp
  453.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-web-get-1.tgz .
  454.   cd /
  455.   tar zxf /tmp/upd-web-get-1.tgz
  456.   # Generation d'une heure de mirroring aleatoire
  457.   r=`/usr/local/sbin/rand60`
  458.   if [ $r -ge 0 -a $r -lt 10 ]; then h="21"; fi
  459.   if [ $r -ge 10 -a $r -lt 20 ]; then h="22"; fi
  460.   if [ $r -ge 20 -a $r -lt 30 ]; then h="23"; fi
  461.   if [ $r -ge 30 -a $r -lt 40 ]; then h="00"; fi
  462.   if [ $r -ge 40 -a $r -lt 50 ]; then h="01"; fi
  463.   if [ $r -ge 50 ]; then h="02"; fi
  464.   $SLIS_BINDIR/remplace 23 $h $SLIS_BINDIR/mkwgetlauncher
  465.   mkdir /home/httpd/html/miroirs
  466.   touch /home/httpd/html/miroirs/.miroirs
  467.   chmod 755 $SLIS_BINDIR/mkwgetlauncher
  468.   $SLIS_BINDIR/mkwgetlauncher
  469.  
  470.   touch $UPDDIR/CS-1b
  471.   logger -t "$LOGTAG" "Update CS-1b effectuee."
  472. fi
  473. ###
  474.  
  475. ############################################################################
  476. ### Mise a jour CS-2 - 02/10/2000
  477. # Correction de quelques petits bugs:
  478. # - web_get*: simplification et modif de la fonction d'aspiration et ajout
  479. # d'explications sur la recursivite. Correc faute d'orthographe.
  480. # - users_listdel.html: message "obsolete"
  481. # - squid_purge: ajout d'un GMT-2 pour workaround heures affichees par prostat
  482. # Rend obsolete : CS-2
  483. ############################################################################
  484.  
  485. if [ ! \( -e $UPDDIR/CS-2 \) ]
  486. then
  487.   cd /tmp
  488.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-CS-2.tgz .
  489.   cd /
  490.   tar zxf /tmp/upd-CS-2.tgz
  491.  
  492.   touch $UPDDIR/CS-2
  493.   logger -t "$LOGTAG" "Update CS-2 effectuee."
  494. fi
  495. ###
  496.  
  497. ############################################################################
  498. ### Mise a jour 1.4-10 - 02/10/2000
  499. # Update securite syslog
  500. # Rend obsolete :
  501. ############################################################################
  502.  
  503. if [ ! \( -e $UPDDIR/1.4-10 \) ]
  504. then
  505.  
  506.   cd /tmp
  507.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/sysklogd-1.3.31-1.6.i386.rpm .
  508.   rpm -U ./sysklogd-1.3.31-1.6.i386.rpm
  509.   /etc/rc.d/init.d/syslog restart
  510.  
  511.   touch $UPDDIR/1.4-10
  512.   logger -t "$LOGTAG" "Update 1.4-10 effectuee."
  513. fi
  514. ###
  515.  
  516. ############################################################################
  517. ### Mise a jour 1.4-11 - 09/10/2000
  518. # Ajout du code mime de shockwave
  519. # Rend obsolete :
  520. ############################################################################
  521.  
  522. if [ ! \( -e $UPDDIR/1.4-11 \) ]
  523. then
  524.   echo "application/x-shockwave-flash   swf" >> /etc/mime.types
  525.   echo "application/x-shockwave-flash   swf" >> /usr/local/etc/mime.types
  526.  
  527.   touch $UPDDIR/1.4-11
  528.   logger -t "$LOGTAG" "Update 1.4-11 effectuee."
  529. fi
  530. ###
  531.  
  532. ############################################################################
  533. ### Mise a jour 1.4-13 - 22/10/2000
  534. # Nouveau binaire sendmail et nouvelle conf avec anti-spam
  535. # Rend obsolete :
  536. ############################################################################
  537.  
  538. if [ ! \( -e $UPDDIR/1.4-13 \) ]
  539. then
  540.  
  541.   # Telechargement de l'update
  542.   cd /tmp
  543.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-1.x-13.tgz .
  544.  
  545.   # Arret de sendmail
  546.   /etc/rc.d/init.d/sendmail stop >/dev/null 2>/dev/null
  547.   sleep 3
  548.   /etc/rc.d/init.d/sendmail stop >/dev/null 2>/dev/null
  549.   sleep 1
  550.   killall -9 sendmail >/dev/null 2>/dev/null
  551.   # Si apres ca, il n'est pas mort..!
  552.  
  553.   # Decompactage
  554.   cd /
  555.   tar zxf /tmp/upd-1.x-13.tgz
  556.   touch /etc/mail/statistics
  557.   ln -s /etc/sendmail.cf /etc/mail/sendmail.cf
  558.  
  559.   # Lancement du configurateur
  560.   $SLIS_BINDIR/mksendmailcf
  561.  
  562.   # Demarrage de sendmail
  563.   /etc/rc.d/init.d/sendmail start >/dev/null 2>/dev/null
  564.  
  565.   touch $UPDDIR/1.4-13
  566.   logger -t "$LOGTAG" "Update 1.4-13 effectuee."
  567. fi
  568. ###
  569.  
  570. ############################################################################
  571. ### Mise a jour CS-3 - 26/10/2000
  572. # Nouveau sendmail.cf
  573. # Rend obsolete :
  574. ############################################################################
  575.  
  576. if [ ! \( -e $UPDDIR/CS-3 \) ]
  577. then
  578.  
  579.   # Telechargement de l'update
  580.   cd /etc
  581.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/sendmail.cf.slis.gz .
  582.   rm -rf sendmail.cf.slis
  583.   gzip -d sendmail.cf.slis.gz
  584.  
  585.   # Arret de sendmail
  586.   /etc/rc.d/init.d/sendmail stop >/dev/null 2>/dev/null
  587.   sleep 3
  588.   /etc/rc.d/init.d/sendmail stop >/dev/null 2>/dev/null
  589.   sleep 1
  590.   killall -9 sendmail >/dev/null 2>/dev/null
  591.   # Si apres ca, il n'est pas mort..!
  592.  
  593.   # Lancement du configurateur
  594.   $SLIS_BINDIR/mksendmailcf
  595.  
  596.   # Demarrage de sendmail
  597.   /etc/rc.d/init.d/sendmail start >/dev/null 2>/dev/null
  598.  
  599.   touch $UPDDIR/CS-3
  600.   logger -t "$LOGTAG" "Update CS-3 effectuee."
  601. fi
  602. ###
  603.  
  604. ############################################################################
  605. ### Mise a jour CS-5 - 04/12/2000
  606. # Bug de mkwgetlaucher et mkpushsiteconf (crontab mal programmee)
  607. # Rend obsolete : C-5
  608. ############################################################################
  609.   
  610. if [ ! \( -e $UPDDIR/CS-5 \) ]
  611. then
  612.   # Aspiration
  613.   cd /usr/local/sbin
  614.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/mkwgetlauncher .
  615.   chmod 755 /usr/local/sbin/mkwgetlauncher
  616.   /usr/local/sbin/mkwgetlauncher
  617.  
  618.   # Replication
  619.   cd /usr/local/sbin
  620.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/mkpushsiteconf .
  621.   chmod 755 /usr/local/sbin/mkpushsiteconf
  622.   /usr/local/sbin/mkpushsiteconf
  623.  
  624.   touch $UPDDIR/CS-5
  625.   logger -t "$LOGTAG" "UPDATE CS-5 effectuee"
  626. fi
  627. ###
  628.  
  629. ############################################################################
  630. ### Mise a jour 1.4-15 - 09/12/2000
  631. # Mise a jour du systeme rpm
  632. # Rend obsolete :
  633. ############################################################################
  634.  
  635. if [ ! \( -e $UPDDIR/1.4-15 \) ]
  636. then
  637.  
  638.   # Telechargement du RPM
  639.   cd /tmp
  640.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/rpm-3.0.5-9.5x.i386.rpm .
  641.  
  642.   # Installation du RPM
  643.   rpm -U rpm-3.0.5-9.5x.i386.rpm
  644.   rpm --rebuilddb
  645.  
  646.   # Verification et fin de la MAJ
  647.   rpm -q rpm-3.0.5-9.5x > /dev/null 2> /dev/null
  648.   if [ $? = 0 ]
  649.   then
  650.     touch $UPDDIR/1.4-15
  651.     logger -t "$LOGTAG" "Update 1.4-15 effectuee."
  652.   else
  653.     logger -t "$LOGTAG" "Update 1.4-15 ECHEC."
  654.   fi
  655. fi
  656. ###
  657.  
  658. ############################################################################
  659. ### Mise a jour 1.4-16 - 09/12/2000
  660. # Install de postgres
  661. # Rend obsolete :
  662. ############################################################################
  663.  
  664. if [ ! \( -e $UPDDIR/1.4-16 \) ]
  665. then
  666.  
  667.   # Telechargement des RPMS
  668.   cd /tmp
  669.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/postgresql-7.0.3-2rh5x.i386.rpm .
  670.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/postgresql-server-7.0.3-2rh5x.i386.rpm .  
  671.  
  672.   # Installation des RPMS
  673.   rpm -U postgresql-7.0.3-2rh5x.i386.rpm
  674.   rpm -U postgresql-server-7.0.3-2rh5x.i386.rpm 2> /dev/null
  675.   /sbin/ldconfig
  676.  
  677.   # Verification et fin de la MAJ
  678.   rpm -q postgresql-server-7.0.3-2 > /dev/null 2> /dev/null
  679.   if [ $? = 0 ]
  680.   then
  681.     touch $UPDDIR/1.4-16
  682.     logger -t "$LOGTAG" "Update 1.4-16 effectuee."
  683.   else
  684.     logger -t "$LOGTAG" "Update 1.4-16 ECHEC."
  685.   fi
  686. fi
  687. ###
  688.  
  689. ############################################################################
  690. ### Mise a jour 1.4-17 - 10/12/2000
  691. # Install de php4+mod_php4+php-pgsql
  692. # Rend obsolete :
  693. ############################################################################
  694.  
  695. if [ ! \( -e $UPDDIR/1.4-17 \) ]
  696. then
  697.  
  698.   # Telechargement des RPMS
  699.   cd /tmp
  700.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/php-4.0.3pl1-1slis1x.i386.rpm .
  701.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/php-pgsql-4.0.3pl1-1slis1x.i386.rpm .
  702.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/mod_php-4.0.3pl1-1slis1x.i386.rpm .
  703.  
  704.   # Installation des RPMS
  705.   rpm -U php-4.0.3pl1-1slis1x.i386.rpm
  706.   rpm -U php-pgsql-4.0.3pl1-1slis1x.i386.rpm
  707.   rpm -U mod_php-4.0.3pl1-1slis1x.i386.rpm
  708.  
  709.   # Verification et fin de la MAJ
  710.   rpm -q php-pgsql-4.0.3pl1-1slis1x > /dev/null 2> /dev/null
  711.   RC1=$?
  712.   rpm -q mod_php-4.0.3pl1-1slis1x > /dev/null 2> /dev/null
  713.   if [ $? = 0 -a $RC1 = 0 ]
  714.   then
  715.     # Un php.ini specifique pour hadmin
  716.     sed "s/max_execution_time = 30/max_execution_time = 120/" /etc/php.ini > /etc/hadmin/php.ini
  717.     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
  718.     cp -f /etc/rc.d/rc.local /etc/rc.d/rc.local.upd-1.4-17
  719.     mv -f /tmp/rc.local /etc/rc.d/rc.local
  720.     chmod 755 /etc/rc.d/rc.local
  721.     
  722.     # Activation du safe mode php dans le php.ini du httpd standard
  723.     sed "s/^safe_mode.*=.*Off/safe_mode = On/" /etc/php.ini > /tmp/php.ini
  724.     mv -f /tmp/php.ini /etc/php.ini
  725.     sed "s,safe_mode_exec_dir.*=.*,safe_mode_exec_dir = /usr/local/phpexec," /etc/php.ini > /tmp/php.ini
  726.     mv -f /tmp/php.ini /etc/php.ini
  727.     mkdir /usr/local/phpexec
  728.  
  729.     # Flag de la MAJ
  730.     touch $UPDDIR/1.4-17
  731.     logger -t "$LOGTAG" "Update 1.4-17 effectuee."
  732.   else
  733.     logger -t "$LOGTAG" "Update 1.4-17 ECHEC."
  734.   fi
  735. fi
  736. ###
  737.  
  738. ############################################################################
  739. ### Mise a jour 1.4-18 - 10/12/2000
  740. # MAJ d'apache
  741. # Rend obsolete :
  742. ############################################################################
  743.  
  744. if [ ! \( -e $UPDDIR/1.4-18 \) ]
  745. then
  746.  
  747.   # Telechargement des paquetages
  748.   cd /tmp
  749.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/apache-1.3.14-2.5.x.i386.rpm .
  750.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-1.x-18.tgz .
  751.  
  752.   # Installation du RPM apache et de l'archive contenant la conf
  753.   /etc/rc.d/init.d/httpd stop
  754.   killall httpd
  755.   rpm -U apache-1.3.14-2.5.x.i386.rpm
  756.   cd /
  757.   tar zxf /tmp/upd-1.x-18.tgz
  758.   RC1=$?
  759.  
  760.   # Remise en etat des droits au cas ou l'archive ne soit pas correcte
  761.   chown -R hadmin.hadmin /etc/hadmin
  762.   chmod -R 750 /etc/hadmin
  763.   chown -R nobody.nobody /etc/httpd
  764.   chmod -R 750 /etc/httpd
  765.  
  766.   # Lien pour les modules (version slis < 2.0)
  767.   ln -fs /etc/httpd/modules/ /etc/hadmin/modules
  768.  
  769.   # Redemarrage
  770.   /etc/rc.d/init.d/httpd start
  771.   export PHPRC="/etc/hadmin"
  772.   /usr/sbin/httpd -f /etc/hadmin/conf/httpd.conf
  773.   export -n PHPRC
  774.  
  775.   # Verifications et fin de la MAJ  
  776.   rpm -q apache-1.3.14-2.5.x > /dev/null 2> /dev/null
  777.   if [ $? = 0 -a $RC1 = 0 ]
  778.   then
  779.     touch $UPDDIR/1.4-18
  780.     logger -t "$LOGTAG" "Update 1.4-18 effectuee."
  781.   else
  782.     logger -t "$LOGTAG" "Update 1.4-18 ECHEC."
  783.   fi
  784. fi
  785. ###
  786.  
  787. ############################################################################
  788. ### Mise a jour CS-6 - 05/12/2000
  789. # Initialisation de postgres
  790. # Rend obsolete :
  791. ############################################################################
  792.  
  793. if [ ! \( -e $UPDDIR/CS-6 \) ]
  794. then
  795.   # Telechargement du tar
  796.   cd /tmp
  797.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-CS-6.tgz .
  798.   cd /
  799.   tar zxf /tmp/upd-CS-6.tgz
  800.   chmod 1777 /tmp
  801.  
  802.   # mot de passe postgres
  803.   POSTGRESPASS=`$SLIS_BINDIR/pspg`
  804.  
  805.   # mot de passe hadmin
  806.   ADMINPASS=`$SLIS_BINDIR/pspg`
  807.  
  808.   # mot de passe slis
  809.   SLISPASS=`$SLIS_BINDIR/pspg`
  810.  
  811.   #  Stockage des mots de passe dans des fichiers de conf
  812.   # Fichier de conf pour le php de l'interface SLIS
  813.   echo "<?php" > /home/hadmin/html/config_pgsql.inc.php
  814.   echo "\$POSTGRESPASS=\"$POSTGRESPASS\";" >> /home/hadmin/html/config_pgsql.inc.php
  815.   echo "\$POSTGRESUSER=\"postgres\";" >> /home/hadmin/html/config_pgsql.inc.php
  816.   echo "\$ADMINPASS=\"$ADMINPASS\";" >> /home/hadmin/html/config_pgsql.inc.php
  817.   echo "\$ADMINUSER=\"hadmin\";" >> /home/hadmin/html/config_pgsql.inc.php
  818.   echo "\$SLISPASS=\"$SLISPASS\";" >> /home/hadmin/html/config_pgsql.inc.php
  819.   echo "\$SLISUSER=\"slis\";" >> /home/hadmin/html/config_pgsql.inc.php
  820.   echo "\$PGSQL_SERVER=\"127.0.0.1\";" >> /home/hadmin/html/config_pgsql.inc.php
  821.   echo "\$BASE_HADMIN=\"hadmin\";" >> /home/hadmin/html/config_pgsql.inc.php
  822.   echo "\$BASE_DHCP=\"dhcp\";" >> /home/hadmin/html/config_pgsql.inc.php
  823.   echo "\$BASE_SLIS=\"slis\";" >> /home/hadmin/html/config_pgsql.inc.php
  824.   echo "?>" >> /home/hadmin/html/config_pgsql.inc.php  
  825.  
  826.   # Fichier de conf pour perl
  827.   echo "\$POSTGRESPASS=\"$POSTGRESPASS\";" > /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
  828.   echo "\$POSTGRESUSER=\"postgres\";" >> /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
  829.   echo "\$ADMINPASS=\"$ADMINPASS\";" >> /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
  830.   echo "\$ADMINUSER=\"hadmin\";" >> /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
  831.   echo "\$SLISPASS=\"$SLISPASS\";" >> /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
  832.   echo "\$SLISUSER=\"slis\";" >> /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
  833.   echo "\$PGSQL_SERVER=\"127.0.0.1\";" >> /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
  834.   echo "\$BASE_HADMIN=\"hadmin\";" >> /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
  835.   echo "\$BASE_DHCP=\"dhcp\";" >> /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
  836.   echo "\$BASE_SLIS=\"slis\";" >> /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
  837.  
  838.   # Fichier de conf pour le php des utilisateurs
  839.   echo "<?php" > /home/httpd/html/config_pgsql.inc.php
  840.   echo "\$PGSQL_PASS=\"$SLISPASS\";" >> /home/httpd/html/config_pgsql.inc.php
  841.   echo "\$PGSQL_USER=\"slis\";" >> /home/httpd/html/config_pgsql.inc.php
  842.   echo "\$PGSQL_SERVER=\"127.0.0.1\";" >> /home/httpd/html/config_pgsql.inc.php
  843.   echo "\$PGSQL_BASE=\"slis\";" >> /home/httpd/html/config_pgsql.inc.php
  844.   echo "?>" >> /home/httpd/html/config_pgsql.inc.php  
  845.  
  846.   # Securite sur ces fichiers de config
  847.   chmod 750 /home/hadmin/html/config_pgsql.inc.php
  848.   chown hadmin.hadmin /home/hadmin/html/config_pgsql.inc.php
  849.   chmod 750 /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
  850.   chown hadmin.hadmin /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
  851.   chmod 750 /home/httpd/html/config_pgsql.inc.php
  852.   chown nobody.nobody /home/httpd/html/config_pgsql.inc.php
  853.  
  854.   # Premier demarrage de postgres
  855.   /etc/rc.d/init.d/postgresql start
  856.  
  857.   # Config du boot
  858.   /sbin/chkconfig --add postgresql
  859.  
  860.   # Appel du script d'init qui tourne sous postgres
  861.   su - postgres -c "$SLIS_BINDIR/init_pgsql.sh $POSTGRESPASS $ADMINPASS $SLISPASS> /dev/null"
  862.   rm -rf /tmp/dhcp.dump
  863.  
  864.   touch $UPDDIR/CS-6
  865.   logger -t "$LOGTAG" "UPDATE CS-6 effectuee"   
  866. fi
  867. ###
  868.  
  869. ############################################################################
  870. ### Mise a jour CS-7 - 05/12/2000
  871. # Installation de l'interface d'administration dhcp
  872. # Rend obsolete :
  873. ############################################################################
  874.  
  875. if [ ! \( -e $UPDDIR/CS-7 \) ]
  876. then
  877.   # Telechargement du tar
  878.   cd /tmp
  879.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-CS-7.tgz .
  880.   cd /
  881.   tar zxf /tmp/upd-CS-7.tgz
  882.   RC=$?
  883.  
  884.   # Verification et fin de la MAJ
  885.   if [ $RC = 0 ]
  886.   then
  887.     touch $UPDDIR/CS-7
  888.     logger -t "$LOGTAG" "Update CS-7 effectuee."
  889.   else
  890.     logger -t "$LOGTAG" "Update CS-7 ECHEC."
  891.   fi
  892. fi
  893. ###
  894.  
  895. ############################################################################
  896. ### Mise a jour CS-8 - 07/12/2000
  897. # Installation de phppgadmin
  898. # Rend obsolete :
  899. ############################################################################
  900.  
  901. if [ ! \( -e $UPDDIR/CS-8 \) ]
  902. then
  903.   # Telechargement du tar
  904.   cd /tmp
  905.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-CS-8.tgz .
  906.   cd /
  907.   tar zxf /tmp/upd-CS-8.tgz
  908.   RC=$?
  909.  
  910.   # Verification et fin de la MAJ
  911.   if [ $RC = 0 ]
  912.   then
  913.     touch $UPDDIR/CS-8
  914.     logger -t "$LOGTAG" "Update CS-8 effectuee."
  915.   else
  916.     logger -t "$LOGTAG" "Update CS-8 ECHEC."
  917.   fi
  918. fi
  919. ###
  920.  
  921. ############################################################################
  922. ### Mise a jour CS-9 - 07/12/2000
  923. # Patch pour supprimmer postgres des users affich<E9>s
  924. # Rend obsolete :
  925. ############################################################################
  926.  
  927. if [ ! \( -e $UPDDIR/CS-9 \) ]
  928. then
  929.   # Telechargement du tar
  930.   cd /tmp
  931.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-CS-9.tgz .
  932.   cd /
  933.   tar zxf /tmp/upd-CS-9.tgz
  934.   RC=$?
  935.  
  936.   # Verification et fin de la MAJ
  937.   if [ $RC = 0 ]
  938.   then
  939.     touch $UPDDIR/CS-9
  940.     logger -t "$LOGTAG" "Update CS-9 effectuee."
  941.   else
  942.     logger -t "$LOGTAG" "Update CS-9 ECHEC."
  943.   fi
  944. fi
  945. ###
  946.  
  947. ############################################################################
  948. ### Mise a jour CS-10 - 12/12/2000
  949. # MAJ de l'interface dhcp
  950. # Rend obsolete :
  951. ############################################################################
  952.  
  953. if [ ! \( -e $UPDDIR/CS-10 \) ]
  954. then
  955.   # Telechargement du tar
  956.   cd /tmp
  957.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-CS-10.tgz .
  958.   cd /
  959.   tar zxf /tmp/upd-CS-10.tgz
  960.   RC=$?
  961.  
  962.   # Verification et fin de la MAJ
  963.   if [ $RC = 0 ]
  964.   then
  965.     touch $UPDDIR/CS-10
  966.     logger -t "$LOGTAG" "Update CS-10 effectuee."
  967.   else
  968.     logger -t "$LOGTAG" "Update CS-10 ECHEC."
  969.   fi
  970. fi
  971. ###
  972.  
  973. ############################################################################
  974. ### Mise a jour 1.4-20 - 10/12/2000
  975. # Conf de logrotate pour syslog
  976. # Rend obsolete :
  977. ############################################################################
  978.  
  979. if [ ! \( -e $UPDDIR/1.4-20 \) ]
  980. then
  981.   echo "
  982. /var/log/arpwatch {
  983.   postrotate
  984.         /usr/bin/killall -HUP syslogd
  985.   endscript
  986. }
  987.  
  988. /var/log/slis {
  989.   postrotate
  990.         /usr/bin/killall -HUP syslogd
  991.   endscript
  992. }
  993.  
  994. " >> /etc/logrotate.d/syslog
  995.     touch $UPDDIR/1.4-20
  996.     logger -t "$LOGTAG" "Update 1.4-20 effectuee."
  997. fi
  998. ###
  999.  
  1000. ############################################################################
  1001. ### Mise a jour 1.4-21 - 10/12/2000
  1002. # Nouveaux menus "fonction avancees"
  1003. # Rend obsolete : Les fichiers correspondant dans upd-CS-8.tgz
  1004. ############################################################################
  1005.  
  1006. if [ ! \( -e $UPDDIR/1.4-21 \) ]
  1007. then
  1008.  
  1009.   # Telechargement du tar
  1010.   cd /tmp
  1011.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-1.x-21.tgz .
  1012.   cd /
  1013.   tar zxf /tmp/upd-1.x-21.tgz
  1014.   RC=$?
  1015.  
  1016.   # Verification et fin de la MAJ
  1017.   if [ $RC = 0 ]
  1018.   then
  1019.     touch $UPDDIR/1.4-21
  1020.     logger -t "$LOGTAG" "Update 1.4-21 effectuee."
  1021.   else   
  1022.     logger -t "$LOGTAG" "Update 1.4-21 ECHEC."
  1023.   fi
  1024. fi
  1025. ###
  1026.  
  1027. ############################################################################
  1028. ### Mise a jour CS-11 - 15/12/2000
  1029. # Patch de l'interface dhcp
  1030. # Rend obsolete :
  1031. ############################################################################
  1032.  
  1033. if [ ! \( -e $UPDDIR/CS-11 \) ]
  1034. then
  1035.   # Telechargement du tar
  1036.   cd /tmp
  1037.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-CS-11.tgz .
  1038.   cd /
  1039.   tar zxf /tmp/upd-CS-11.tgz
  1040.   RC=$?
  1041.  
  1042.   # Verification et fin de la MAJ
  1043.   if [ $RC = 0 ]
  1044.   then
  1045.     touch $UPDDIR/CS-11
  1046.     logger -t "$LOGTAG" "Update CS-11 effectuee."
  1047.   else
  1048.     logger -t "$LOGTAG" "Update CS-11 ECHEC."
  1049.   fi
  1050. fi
  1051. ###
  1052.  
  1053. ############################################################################
  1054. ### Mise a jour 1.4-17b - 15/12/2000
  1055. # Bug de 1.4-17
  1056. # Rend obsolete : 1.3-17a
  1057. ############################################################################
  1058.  
  1059. if [ ! \( -e $UPDDIR/1.4-17b \) ]
  1060. then
  1061.     
  1062.   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
  1063.   /etc/rc.d/init.d/httpd stop
  1064.   killall httpd
  1065.   rm -rf /var/lock/subsys/httpd
  1066.   rm -rf /var/run/httpd.pid
  1067.   rm -rf /var/run/httpd*lock*
  1068.   sleep 6
  1069.   /etc/rc.d/init.d/httpd start
  1070.   export PHPRC="/etc/hadmin"
  1071.   /usr/sbin/httpd -f /etc/hadmin/conf/httpd.conf
  1072.   export -n PHPRC  
  1073.  
  1074.   touch $UPDDIR/1.4-17b
  1075.   logger -t "$LOGTAG" "Update 1.4-17b effectuee."
  1076. fi
  1077. ###
  1078.  
  1079. ############################################################################
  1080. ### Mise a jour 1.4-24b - 02/02/2001
  1081. # SECURITE BIND
  1082. # Rend obsolete : 1.4-24
  1083. ############################################################################
  1084.  
  1085. if [ ! \( -e $UPDDIR/1.4-24b \) ]
  1086. then
  1087.  
  1088.   cd /tmp
  1089.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/bind-8.2.3-0.5.x.i386.rpm .
  1090.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/bind-utils-8.2.3-0.5.x.i386.rpm .
  1091.   rpm -U bind-8.2.3-0.5.x.i386.rpm
  1092.   rpm -U bind-utils-8.2.3-0.5.x.i386.rpm
  1093.  
  1094.   # Verifications
  1095.   rpm -q bind-utils-8.2.3 2>/dev/null >/dev/null
  1096.   RC=$?
  1097.   rpm -q bind-8.2.3 2>/dev/null >/dev/null
  1098.   if [ $? = 0 -a $RC = 0 ]
  1099.   then
  1100.     /etc/rc.d/init.d/named restart
  1101.     touch $UPDDIR/1.4-24b
  1102.     logger -t "$LOGTAG" "UPDATE 1.4-24b effectuee"
  1103.   else
  1104.     logger -t "$LOGTAG" "UPDATE 1.4-24b ECHEC."
  1105.   fi
  1106. fi
  1107. ###
  1108.  
  1109. ############################################################################
  1110. ### Mise a jour 1.4-26 - 29/01/2001
  1111. # Installation de xntpd
  1112. # Rend obsolete :
  1113. ############################################################################
  1114.  
  1115. if [ ! \( -e $UPDDIR/1.4-26 \) ]
  1116. then
  1117.  
  1118.   cd /tmp
  1119.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/xntp3-5.93-4.i386.rpm .
  1120.   rpm -U xntp3-5.93-4.i386.rpm
  1121.  
  1122.   # Verifications et fin de l'install
  1123.   rpm -q xntp3-5.93-4 2>/dev/null >/dev/null
  1124.   RC=$?
  1125.   if [ $RC = 0 ]
  1126.   then
  1127.     chkconfig --add xntpd
  1128.     /etc/rc.d/init.d/xntpd start
  1129.     touch $UPDDIR/1.4-26
  1130.     logger -t "$LOGTAG" "UPDATE 1.4-26 effectuee"
  1131.   else
  1132.     logger -t "$LOGTAG" "UPDATE 1.4-26 ECHEC."
  1133.   fi
  1134. fi
  1135. ###
  1136.  
  1137. ############################################################################
  1138. ### Mise a jour 1.x-27 - 30/01/2001
  1139. # Interface de configuration de l'onduleur
  1140. # Rend obsolete :
  1141. ############################################################################
  1142.  
  1143. if [ ! \( -e $UPDDIR/1.x-27 \) ]
  1144. then
  1145.  
  1146.   # Si on ne tue pas mgeupsd, alors le tar va echouer
  1147.   killall mgeupsd
  1148.  
  1149.   # Telechargement du tar
  1150.   cd /tmp
  1151.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-1.x-27.tgz .
  1152.   cd /
  1153.   tar zxf /tmp/upd-1.x-27.tgz
  1154.   RC=$?
  1155.  
  1156.   # Verification et fin de la MAJ
  1157.   if [ $RC = 0 ]
  1158.   then
  1159.     touch $UPDDIR/1.x-27
  1160.     logger -t "$LOGTAG" "Update 1.x-27 effectuee."
  1161.   else
  1162.     logger -t "$LOGTAG" "Update 1.x-27 ECHEC."
  1163.   fi
  1164. fi
  1165. ###
  1166.  
  1167. ############################################################################
  1168. ### Mise a jour CS-12 - 01/02/2001
  1169. # Amelioration des fonctions de filtrage d'url
  1170. # Rend obsolete :
  1171. ############################################################################
  1172.  
  1173. if [ ! \( -e $UPDDIR/CS-12 \) ]
  1174. then
  1175.   # Telechargement du tar
  1176.   cd /tmp
  1177.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-CS-12.tgz .
  1178.   cd /
  1179.   tar zxf /tmp/upd-CS-12.tgz
  1180.   RC=$?
  1181.  
  1182.   # Verification et fin de la MAJ
  1183.   if [ $RC = 0 ]
  1184.   then
  1185.     touch $UPDDIR/CS-12
  1186.     logger -t "$LOGTAG" "Update CS-12 effectuee."
  1187.   else
  1188.     logger -t "$LOGTAG" "Update CS-12 ECHEC."
  1189.   fi
  1190. fi
  1191. ###
  1192.  
  1193. ############################################################################
  1194. ### Mise a jour PQ - 05/04/2000
  1195. # Nouveau script /usr/local/sbin/process_queue
  1196. # Rend obsolete : 004-0 a 004-7 et PQ-1 PQ-2 PQ-3 PQ-4 PQ-5
  1197. # Si un nouveau process_queue est rΘalisΘ, juste remplacer le numero de
  1198. # version et le fichier.
  1199. # ATTENTION: Laisser cette UPD en fin de fichier, avant les UPD KERNEL.
  1200. ############################################################################
  1201. VERSION=7
  1202. DELAI=5 # Delai en minutes. C'est le temps estime que prendra l'execution de
  1203.         # la fin de ce script plus une marge (install d'un nouveau slis)...
  1204.  
  1205. if [ ! \( -e $UPDDIR/PQ-$VERSION \) ]
  1206. then
  1207.   PAS_UPD_KERNEL=1 # Empeche de faire une update du noyau
  1208.  
  1209.   # Telechargement du nouveau fichier
  1210.   cd /tmp
  1211.   rsync rsync://$RSYNC/$MODULE/process_queue .
  1212.   # slis_update est lance par process_queue, donc il faut faire attention
  1213.   # a ne pas le remplacer tout de suite:
  1214.   echo "mv -f /tmp/process_queue /usr/local/sbin/ ; chmod 700 /usr/local/sbin/process_queue" | at now + $DELAI minutes
  1215.  
  1216.   touch $UPDDIR/PQ-$VERSION
  1217.   logger -t "$LOGTAG" "UPDATE PQ-$VERSION effectuee."
  1218. fi
  1219. ###
  1220.  
  1221. ############################################################################
  1222. ### Mise a jour NOTIFY - 29/04/99
  1223. # Notify
  1224. # Rend obsolete : 
  1225. ############################################################################
  1226.  
  1227. if [ ! \( -e $UPDDIR/NOTIFY \) ]
  1228. then
  1229.   echo "$HOSTNAME installe et MAJ" | mail -s "Nouveau SLIS 1.4" $SLISMASTER
  1230.   sleep 2
  1231.   /usr/lib/sendmail -q
  1232.   killall crond
  1233.   sleep 1
  1234.   crond
  1235.  
  1236.   touch $UPDDIR/NOTIFY
  1237.   logger -t "$LOGTAG" "NOTIFY envoye."
  1238. fi
  1239. ###
  1240.  
  1241.  
  1242.  
  1243. ##############################
  1244. logger -t "$LOGTAG" "Script Version 1.4 Termine."
  1245.  
  1246. /bin/rm -rf /var/lock/slis_upd
  1247.