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-2.0 < prev    next >
Text File  |  2004-06-22  |  127KB  |  4,376 lines

  1. #!/bin/bash
  2.  
  3. # slis_update-2.0
  4. # Script de mise α jour tΘlΘchargΘ rΘguliΦrement par rsync par tous les
  5. # serveurs SLIS version initiale 2.0
  6.  
  7. # This script is part of the SLIS Project initiated by the CARMI-Internet
  8. # (AcadΘmie de Grenoble - France 38).
  9. # Ce script fait partie du projet SLIS dΘmarrΘ par le CARMI-Internet
  10. # (AcadΘmie de Grenoble - France 38).
  11. #
  12. # SLIS : Serveur de communications Linux pour l'Internet Scolaire.
  13. # Copyright (C) 1998-2000 Bruno Bzeznik
  14. #
  15. #    This program is free software; you can redistribute it and/or modify
  16. #    it under the terms of the GNU General Public License as published by
  17. #    the Free Software Foundation; either version 2 of the License, or
  18. #    (at your option) any later version.
  19. #
  20. #    This program is distributed in the hope that it will be useful,
  21. #    but WITHOUT ANY WARRANTY; without even the implied warranty of
  22. #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  23. #    GNU General Public License for more details.
  24. #    You should have received a copy of the GNU General Public License
  25. #    along with this program (For example ./COPYING);
  26. #    if not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  27. #    Cambridge, MA 02139, USA.
  28. #
  29. # Please send all comments and bug reports by electronic mail to:
  30. #   Bruno Bzeznik <Bruno@ac-grenoble.fr>
  31. # or to <slis@ac-grenoble.fr>
  32. #
  33. # Envoyez vos suggestions et reports de bugs par e-mail α
  34. #   Bruno Bzeznik <Bruno@ac-grenoble.fr>
  35. # ou α <slis@ac-grenoble.fr>
  36. #
  37.  
  38. ### VARIABLES ###
  39. UPDDIR=/home/hadmin/updates # Rep pour les flags
  40. LOGTAG="slis_update[$$]" # Ce qui apparait en syslog
  41. PAS_UPD_KERNEL=0        # Si ce flag est a un, alors la mise a jour du noyau
  42.                 # (qui necessite reboot) ne sera pas faite cette fois.
  43. # Recuperation de la variable HOSTNAME :
  44. grep HOSTNAME /etc/sysconfig/network > /tmp/hostname
  45. . /tmp/hostname
  46. rm -rf /tmp/hostname
  47.  
  48. WEBMASTER=`ls -ld /home/httpd/html |awk '{print $3}'` # Webmaster designΘ par l'admin local
  49.  
  50. . /home/hadmin/slis.conf
  51.  
  52. ##################
  53.  
  54. # Gestion d'un lock
  55. if [ -e /var/lock/slis_upd ]
  56. then 
  57.   logger -t "$LOGTAG" "Deja en cours. Abandon."
  58.   exit
  59. fi
  60. touch /var/lock/slis_upd
  61. sleep 1
  62.  
  63. logger -t "$LOGTAG" "Script Version 2.0 Debut."
  64.  
  65. ############################################################################
  66. ### Mise a jour 2.0-1 - 24/06/2000
  67. # Correction de petits bugs de l'interface quant a l'affichage des utilisateurs
  68. # car dans RH6.2, il y a des comptes en plus dans /etc/passwd
  69. # Rend obsolete :
  70. ############################################################################
  71.     
  72. if [ ! \( -e $UPDDIR/2.0-1 \) ]
  73. then  
  74.   cd /tmp
  75.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.0-1.tgz .
  76.   cd /
  77.   tar zxf /tmp/upd-2.0-1.tgz
  78.   
  79.   touch $UPDDIR/2.0-1
  80.   logger -t "$LOGTAG" "UPDATE 2.0-1 effectuee."
  81. fi
  82. ###
  83.  
  84. ############################################################################
  85. ### Mise a jour 137 - 04/07/2000
  86. # Update securite wu_ftpd
  87. # Rend obsolete :
  88. ############################################################################
  89.  
  90. if [ ! \( -e $UPDDIR/137 \) ]
  91. then
  92.  
  93.   cd /tmp
  94.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/wu-ftpd-2.6.0-14.6x.i386.rpm .
  95.   rpm -U ./wu-ftpd-2.6.0-14.6x.i386.rpm
  96.  
  97.   touch $UPDDIR/137
  98.   logger -t "$LOGTAG" "Update 137 effectuee."
  99. fi
  100. ###
  101.  
  102. ############################################################################
  103. ### Mise a jour 2.0-3b - 04/07/2000
  104. # Ouverture de la ligne numeris (si existante) au demarrage
  105. # Rend obsolete : 2.0-3
  106. ############################################################################
  107.     
  108. if [ ! \( -e $UPDDIR/2.0-3b \) ]
  109. then
  110.   echo "ping -c 1 -w 20 $SMART_HOST_IP > /dev/null" > /etc/rc.d/rc3.d/S11Ouverture_ligne
  111.   echo "ping -c 1 -w 40 $SMART_HOST_IP > /dev/null" >> /etc/rc.d/rc3.d/S11Ouverture_ligne
  112.   chmod 755 /etc/rc.d/rc3.d/S11Ouverture_ligne
  113.   
  114.   touch $UPDDIR/2.0-3b
  115.   logger -t "$LOGTAG" "UPDATE 2.0-3b effectuee."
  116. fi
  117. ###
  118.  
  119. ############################################################################
  120. ### Mise a jour 2.0-5 - 13/07/2000
  121. # Bug smb. Lancement de smb au demarrage
  122. # Rend obsolete: 
  123. ############################################################################
  124.     
  125. if [ ! \( -e $UPDDIR/2.0-5 \) ]
  126. then
  127.   rm -rf /etc/rc.d/rc3.d/K*smb
  128.   rm -rf /etc/rc.d/rc5.d/K*smb
  129.   ln -s /etc/rc.d/init.d/smb /etc/rc.d/rc3.d/S91smb
  130.   ln -s /etc/rc.d/init.d/smb /etc/rc.d/rc5.d/S91smb
  131.   /etc/rc.d/init.d/smb start >/dev/null 2>/dev/null
  132.  
  133.   touch $UPDDIR/2.0-5
  134.   logger -t "$LOGTAG" "UPDATE 2.0-5 effectuee."
  135. fi
  136. ###
  137.  
  138. ############################################################################
  139. ### Mise a jour 2.0-6 - 31/08/2000
  140. # Update securite makewhatis
  141. # Rend obsolete :
  142. ############################################################################
  143.  
  144. if [ ! \( -e $UPDDIR/2.0-6 \) ]
  145. then
  146.  
  147.   cd /tmp
  148.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/man-1.5h1-2.6.x.i386.rpm .
  149.   rpm -U ./man-1.5h1-2.6.x.i386.rpm
  150.  
  151.   touch $UPDDIR/2.0-6
  152.   logger -t "$LOGTAG" "Update 2.0-6 effectuee."
  153. fi
  154. ###
  155.  
  156. ############################################################################
  157. ### Mise a jour 2.0-7 - 31/08/2000
  158. # Update securite pam
  159. # Rend obsolete :
  160. ############################################################################
  161.  
  162. if [ ! \( -e $UPDDIR/2.0-7 \) ]
  163. then
  164.  
  165.   cd /tmp
  166.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/pam-0.72-20.i386.rpm .
  167.   rpm -U ./pam-0.72-20.i386.rpm
  168.  
  169.   touch $UPDDIR/2.0-7
  170.   logger -t "$LOGTAG" "Update 2.0-7 effectuee."
  171. fi
  172. ###
  173.  
  174. ############################################################################
  175. ### Mise a jour 2.0-8b - 27/09/2000
  176. # Nouvelle fonction: aspiration de sites
  177. # Rend obsolete : 2.0-8
  178. ############################################################################
  179.  
  180. if [ ! \( -e $UPDDIR/2.0-8b \) ]
  181. then
  182.  
  183.   cd /tmp
  184.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/wget-1.5.3-6.i386.rpm .
  185.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-web-get.tgz .
  186.   rpm -U ./wget-1.5.3-6.i386.rpm
  187.   cd /
  188.   tar zxf /tmp/upd-web-get.tgz
  189.   $SLIS_BINDIR/mkwgetlauncher
  190.  
  191.   touch $UPDDIR/2.0-8b
  192.   logger -t "$LOGTAG" "Update 2.0-8b effectuee."
  193. fi
  194. ###
  195.  
  196. ############################################################################
  197. ### Mise a jour CS-1b - 28/09/2000
  198. # Ameliorations fonction aspiration de sites
  199. # Rend obsolete : 2.0-9,2.0-9b,2.0-9c,CS-1
  200. ############################################################################
  201.  
  202. if [ ! \( -e $UPDDIR/CS-1b \) ]
  203. then
  204.  
  205.   cd /tmp
  206.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-web-get-1.tgz .
  207.   cd /
  208.   tar zxf /tmp/upd-web-get-1.tgz
  209.   # Generation d'une heure de mirroring aleatoire
  210.   r=`/usr/local/sbin/rand60`
  211.   if [ $r -ge 0 -a $r -lt 10 ]; then h="21"; fi
  212.   if [ $r -ge 10 -a $r -lt 20 ]; then h="22"; fi
  213.   if [ $r -ge 20 -a $r -lt 30 ]; then h="23"; fi
  214.   if [ $r -ge 30 -a $r -lt 40 ]; then h="00"; fi
  215.   if [ $r -ge 40 -a $r -lt 50 ]; then h="01"; fi
  216.   if [ $r -ge 50 ]; then h="02"; fi
  217.   $SLIS_BINDIR/remplace 23 $h $SLIS_BINDIR/mkwgetlauncher
  218.   mkdir /home/httpd/html/miroirs
  219.   touch /home/httpd/html/miroirs/.miroirs
  220.   chmod 755 $SLIS_BINDIR/mkwgetlauncher
  221.   $SLIS_BINDIR/mkwgetlauncher
  222.  
  223.   touch $UPDDIR/CS-1b
  224.   logger -t "$LOGTAG" "Update CS-1b effectuee."
  225. fi
  226. ###
  227.  
  228. ############################################################################
  229. ### Mise a jour CS-2 - 02/10/2000
  230. # Correction de quelques petits bugs:
  231. # - web_get*: simplification et modif de la fonction d'aspiration et ajout 
  232. # d'explications sur la recursivite. Correc faute d'orthographe.
  233. # - users_listdel.html: message "obsolete"
  234. # - squid_purge: ajout d'un GMT-2 pour workaround heures affichees par prostat
  235. # Rend obsolete : CS-2
  236. ############################################################################
  237.  
  238. if [ ! \( -e $UPDDIR/CS-2 \) ]
  239. then
  240.   cd /tmp
  241.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-CS-2.tgz .
  242.   cd /
  243.   tar zxf /tmp/upd-CS-2.tgz
  244.  
  245.   touch $UPDDIR/CS-2
  246.   logger -t "$LOGTAG" "Update CS-2 effectuee."
  247. fi
  248. ###
  249.  
  250. ############################################################################
  251. ### Mise a jour 2.0-10 - 02/10/2000
  252. # Update securite syslog
  253. # Rend obsolete :
  254. ############################################################################
  255.  
  256. if [ ! \( -e $UPDDIR/2.0-10 \) ]
  257. then
  258.  
  259.   cd /tmp
  260.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/sysklogd-1.3.31-17.i386.rpm .
  261.   rpm -U ./sysklogd-1.3.31-17.i386.rpm
  262.   /etc/rc.d/init.d/syslog restart >/dev/null 2>/dev/null
  263.  
  264.   touch $UPDDIR/2.0-10
  265.   logger -t "$LOGTAG" "Update 2.0-10 effectuee."
  266. fi
  267. ###
  268.  
  269. ############################################################################
  270. ### Mise a jour 2.0-12 - 12/10/2000
  271. # Manque un lien
  272. # Rend obsolete :
  273. ############################################################################
  274.  
  275. if [ ! \( -e $UPDDIR/2.0-12 \) ]
  276. then
  277.  
  278.   ln -fs /usr/local/sbin/etrn.pl /usr/local/sbin/etrn
  279.  
  280.   touch $UPDDIR/2.0-12
  281.   logger -t "$LOGTAG" "Update 2.0-12 effectuee."
  282. fi
  283. ###
  284.  
  285. ############################################################################
  286. ### Mise a jour 2.0-13 - 19/10/2000
  287. # Nouveau binaire sendmail et nouvelle conf avec anti-spam
  288. # Rend obsolete :
  289. ############################################################################
  290.  
  291. if [ ! \( -e $UPDDIR/2.0-13 \) ]
  292. then
  293.   
  294.   # Telechargement de l'update
  295.   cd /tmp
  296.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.0-13.tgz .
  297.  
  298.   # Arret de sendmail
  299.   /etc/rc.d/init.d/sendmail stop >/dev/null 2>/dev/null
  300.   sleep 3
  301.   /etc/rc.d/init.d/sendmail stop >/dev/null 2>/dev/null
  302.   sleep 1
  303.   killall -9 sendmail >/dev/null 2>/dev/null
  304.   # Si apres ca, il n'est pas mort..!
  305.  
  306.   # Decompactage
  307.   cd /
  308.   tar zxf /tmp/upd-2.0-13.tgz
  309.   touch /etc/mail/statistics
  310.   ln -s /etc/sendmail.cf /etc/mail/sendmail.cf
  311.  
  312.   # Lancement du configurateur
  313.   $SLIS_BINDIR/mksendmailcf
  314.  
  315.   # Demarrage de sendmail
  316.   /etc/rc.d/init.d/sendmail start >/dev/null 2>/dev/null
  317.  
  318.   touch $UPDDIR/2.0-13
  319.   logger -t "$LOGTAG" "Update 2.0-13 effectuee."
  320. fi
  321. ###
  322.  
  323. ############################################################################
  324. ### Mise a jour CS-3 - 26/10/2000
  325. # Nouveau sendmail.cf
  326. # Rend obsolete :
  327. ############################################################################
  328.  
  329. if [ ! \( -e $UPDDIR/CS-3 \) ]
  330. then
  331.  
  332.   # Telechargement de l'update
  333.   cd /etc
  334.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/sendmail.cf.slis.gz .
  335.   rm -rf sendmail.cf.slis
  336.   gzip -d sendmail.cf.slis.gz
  337.  
  338.   # Arret de sendmail
  339.   /etc/rc.d/init.d/sendmail stop >/dev/null 2>/dev/null
  340.   sleep 3
  341.   /etc/rc.d/init.d/sendmail stop >/dev/null 2>/dev/null
  342.   sleep 1
  343.   killall -9 sendmail >/dev/null 2>/dev/null
  344.   # Si apres ca, il n'est pas mort..!
  345.  
  346.   # Lancement du configurateur
  347.   $SLIS_BINDIR/mksendmailcf
  348.  
  349.   # Demarrage de sendmail
  350.   /etc/rc.d/init.d/sendmail start >/dev/null 2>/dev/null
  351.  
  352.   touch $UPDDIR/CS-3
  353.   logger -t "$LOGTAG" "Update CS-3 effectuee."
  354. fi
  355. ###
  356.  
  357. ############################################################################
  358. ### Mise a jour 2.0-vnc - 5/11/2000
  359. # Nouvelle fonction: prise en main distante sur le reseau local par VNC
  360. # Rend obsolete :
  361. ############################################################################
  362.  
  363. if [ ! \( -e $UPDDIR/2.0-vnc -o -e $UPDDIR/vnc \) ]
  364. then
  365.  
  366.   # Telechargement de l'update
  367.   cd /tmp
  368.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-vnc.tgz .
  369.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/ipmasqadm-0.4.2-2.i386.rpm .
  370.   rpm -U ipmasqadm-0.4.2-2.i386.rpm
  371.   cd /
  372.   tar zxf /tmp/upd-vnc.tgz
  373.  
  374.   # Ajout dans /etc/rc.local
  375.   echo "# Ajout par upd-vnc" >> /etc/rc.d/rc.local
  376.   echo "cp -f /dev/null /var/spool/vncports" >> /etc/rc.d/rc.local
  377.  
  378.   touch $UPDDIR/2.0-vnc
  379.   logger -t "$LOGTAG" "Update vnc effectuee."
  380. fi
  381. ###
  382.  
  383. ############################################################################
  384. ### Mise a jour 2.0-14 - 09/11/2000 - Nouvelle version le 04/12/2000
  385. # Updates securite
  386. # Rend obsolete :
  387. ############################################################################
  388.  
  389. if [ ! \( -e $UPDDIR/2.0-14 \) ]
  390. then
  391.   cd /tmp
  392.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/iputils-20001010-1.6x.i386.rpm .
  393.   rpm -e gnupg
  394.   rpm -e ypbind yp-tools
  395.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/rmt-0.4b19-5.6x.i386.rpm .
  396.   rpm -F iputils-20001010-1.6x.i386.rpm
  397.   rpm -F rmt-0.4b19-5.6x.i386.rpm
  398.  
  399.   touch $UPDDIR/2.0-14
  400.   logger -t "$LOGTAG" "Update 2.0-14 effectuee."
  401. fi
  402. ###
  403.  
  404. ############################################################################
  405. ### Mise a jour 2.0-15 - 27/11/2000
  406. # Mise a jour du systeme rpm
  407. # Rend obsolete :
  408. ############################################################################
  409.  
  410. if [ ! \( -e $UPDDIR/2.0-15 \) ]
  411. then
  412.  
  413.   # Telechargement du RPM
  414.   cd /tmp
  415.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/rpm-3.0.5-9.6x.i386.rpm .
  416.  
  417.   # Installation du RPM
  418.   rpm -U rpm-3.0.5-9.6x.i386.rpm
  419.  
  420.   # Verification et fin de la MAJ
  421.   rpm -q rpm-3.0.5-9.6x > /dev/null 2> /dev/null
  422.   if [ $? = 0 ]
  423.   then
  424.     touch $UPDDIR/2.0-15
  425.     logger -t "$LOGTAG" "Update 2.0-15 effectuee."
  426.   else
  427.     logger -t "$LOGTAG" "Update 2.0-15 ECHEC."
  428.   fi
  429. fi
  430. ###
  431.  
  432. ############################################################################
  433. ### Mise a jour 2.0-16 - 04/12/2000
  434. # Install de postgres
  435. # Rend obsolete :
  436. ############################################################################
  437.  
  438. if [ ! \( -e $UPDDIR/2.0-16 \) ]
  439. then
  440.  
  441.   # Telechargement des RPMS
  442.   cd /tmp
  443.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/postgresql-7.0.3-2.i386.rpm .
  444.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/postgresql-server-7.0.3-2.i386.rpm .  
  445.  
  446.   # Installation des RPMS
  447.   rpm -U postgresql-7.0.3-2.i386.rpm
  448.   rpm -U postgresql-server-7.0.3-2.i386.rpm 2> /dev/null
  449.   /sbin/ldconfig
  450.  
  451.   # Verification et fin de la MAJ
  452.   rpm -q postgresql-server-7.0.3-2 > /dev/null 2> /dev/null
  453.   if [ $? = 0 ]
  454.   then
  455.     touch $UPDDIR/2.0-16
  456.     logger -t "$LOGTAG" "Update 2.0-16 effectuee."
  457.   else
  458.     logger -t "$LOGTAG" "Update 2.0-16 ECHEC."
  459.   fi
  460. fi
  461. ###
  462.  
  463. ############################################################################
  464. ### Mise a jour 2.0-17 - 27/11/2000
  465. # Install de php4+mod_php4+php-pgsql
  466. # Rend obsolete :
  467. ############################################################################
  468.  
  469. if [ ! \( -e $UPDDIR/2.0-17 \) ]
  470. then
  471.  
  472.   # Telechargement des RPMS
  473.   cd /tmp
  474.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/libjpeg-6b-10.i386.rpm .
  475.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/php-4.0.3pl1-1.6.2slis.i386.rpm .
  476.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/php-pgsql-4.0.3pl1-1.6.2slis.i386.rpm .
  477.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/mod_php-4.0.3pl1-1.6.2slis.i386.rpm .
  478.  
  479.   # Installation des RPMS
  480.   rpm -U libjpeg-6b-10.i386.rpm
  481.   rpm -U php-4.0.3pl1-1.6.2slis.i386.rpm
  482.   rpm -U php-pgsql-4.0.3pl1-1.6.2slis.i386.rpm
  483.   rpm -U mod_php-4.0.3pl1-1.6.2slis.i386.rpm
  484.  
  485.   # Verification et fin de la MAJ
  486.   rpm -q php-pgsql-4.0.3pl1-1.6.2slis > /dev/null 2> /dev/null
  487.   RC1=$?
  488.   rpm -q mod_php-4.0.3pl1-1.6.2slis > /dev/null 2> /dev/null
  489.   if [ $? = 0 -a $RC1 = 0 ]
  490.   then
  491.     # Un php.ini specifique pour hadmin
  492.     sed "s/max_execution_time = 30/max_execution_time = 120/" /etc/php.ini > /etc/hadmin/php.ini
  493.     sed "s,/usr/sbin/httpd -f /etc/hadmin/conf/httpd.conf,export PHPRC=\"/etc/hadmin\";/usr/sbin/httpd -f /etc/hadmin/conf/httpd.conf;export -n PHPRC," /etc/rc.d/rc.local > /tmp/rc.local
  494.     cp -f /etc/rc.d/rc.local /etc/rc.d/rc.local.upd-2.0-17
  495.     mv -f /tmp/rc.local /etc/rc.d/rc.local
  496.     chmod 755 /etc/rc.d/rc.local
  497.     
  498.     # Activation du safe mode php dans le php.ini du httpd standard
  499.     sed "s/^safe_mode.*=.*Off/safe_mode = On/" /etc/php.ini > /tmp/php.ini
  500.     mv -f /tmp/php.ini /etc/php.ini
  501.     sed "s,safe_mode_exec_dir.*=.*,safe_mode_exec_dir = /usr/local/phpexec," /etc/php.ini > /tmp/php.ini
  502.     mv -f /tmp/php.ini /etc/php.ini
  503.     mkdir /usr/local/phpexec
  504.  
  505.     # Flag de la MAJ
  506.     touch $UPDDIR/2.0-17
  507.     logger -t "$LOGTAG" "Update 2.0-17 effectuee."
  508.   else
  509.     logger -t "$LOGTAG" "Update 2.0-17 ECHEC."
  510.   fi
  511. fi
  512. ###
  513.  
  514. ############################################################################
  515. ### Mise a jour 2.0-18 - 01/12/2000
  516. # MAJ d'apache
  517. # Rend obsolete :
  518. ############################################################################
  519.  
  520. if [ ! \( -e $UPDDIR/2.0-18 \) ]
  521. then
  522.  
  523.   # Telechargement des paquetages
  524.   cd /tmp
  525.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/apache-1.3.14-2.6.2.i386.rpm .
  526.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.0-18.tgz .
  527.  
  528.   # Installation du RPM apache et de l'archive contenant la conf
  529.   /etc/rc.d/init.d/httpd stop
  530.   killall httpd
  531.   rpm -U apache-1.3.14-2.6.2.i386.rpm
  532.   cd /
  533.   tar zxf /tmp/upd-2.0-18.tgz
  534.   RC1=$?
  535.  
  536.   # Remise en etat des droits au cas ou l'archive ne soit pas correcte
  537.   chown -R hadmin.hadmin /etc/hadmin
  538.   chmod -R 750 /etc/hadmin
  539.   chown -R nobody.nobody /etc/httpd
  540.   chmod -R 750 /etc/httpd
  541.  
  542.   # Redemarrage
  543.   /etc/rc.d/init.d/httpd start
  544.   export PHPRC="/etc/hadmin"
  545.   /usr/sbin/httpd -f /etc/hadmin/conf/httpd.conf
  546.   export -n PHPRC
  547.  
  548.   # Verifications et fin de la MAJ  
  549.   rpm -q apache-1.3.14-2.6.2 > /dev/null 2> /dev/null
  550.   if [ $? = 0 -a $RC1 = 0 ]
  551.   then
  552.     touch $UPDDIR/2.0-18
  553.     logger -t "$LOGTAG" "Update 2.0-18 effectuee."
  554.   else
  555.     logger -t "$LOGTAG" "Update 2.0-18 ECHEC."
  556.   fi
  557. fi
  558. ###
  559.  
  560. ############################################################################
  561. ### Mise a jour CS-5 - 04/12/2000
  562. # Bug de mkwgetlaucher et mkpushsiteconf (crontab mal programmee)
  563. # Rend obsolete : C-5
  564. ############################################################################
  565.  
  566. if [ ! \( -e $UPDDIR/CS-5 \) ]
  567. then
  568.   # Aspiration
  569.   cd /usr/local/sbin
  570.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/mkwgetlauncher .
  571.   chmod 755 /usr/local/sbin/mkwgetlauncher
  572.   /usr/local/sbin/mkwgetlauncher
  573.  
  574.   # Replication
  575.   cd /usr/local/sbin
  576.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/mkpushsiteconf .
  577.   chmod 755 /usr/local/sbin/mkpushsiteconf
  578.   /usr/local/sbin/mkpushsiteconf
  579.   
  580.   touch $UPDDIR/CS-5
  581.   logger -t "$LOGTAG" "UPDATE CS-5 effectuee"   
  582. fi
  583. ###
  584.  
  585. ############################################################################
  586. ### Mise a jour CS-6 - 05/12/2000
  587. # Initialisation de postgres
  588. # Rend obsolete :
  589. ############################################################################
  590.  
  591. if [ ! \( -e $UPDDIR/CS-6 \) ]
  592. then
  593.   # Telechargement du tar
  594.   cd /tmp
  595.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-CS-6.tgz .
  596.   cd /
  597.   tar zxf /tmp/upd-CS-6.tgz
  598.   chmod 1777 /tmp
  599.  
  600.   # mot de passe postgres
  601.   POSTGRESPASS=`$SLIS_BINDIR/pspg`
  602.  
  603.   # mot de passe hadmin
  604.   ADMINPASS=`$SLIS_BINDIR/pspg`
  605.  
  606.   # mot de passe slis
  607.   SLISPASS=`$SLIS_BINDIR/pspg`
  608.  
  609.   #  Stockage des mots de passe dans des fichiers de conf
  610.   # Fichier de conf pour le php de l'interface SLIS
  611.   echo "<?php" > /home/hadmin/html/config_pgsql.inc.php
  612.   echo "\$POSTGRESPASS=\"$POSTGRESPASS\";" >> /home/hadmin/html/config_pgsql.inc.php
  613.   echo "\$POSTGRESUSER=\"postgres\";" >> /home/hadmin/html/config_pgsql.inc.php
  614.   echo "\$ADMINPASS=\"$ADMINPASS\";" >> /home/hadmin/html/config_pgsql.inc.php
  615.   echo "\$ADMINUSER=\"hadmin\";" >> /home/hadmin/html/config_pgsql.inc.php
  616.   echo "\$SLISPASS=\"$SLISPASS\";" >> /home/hadmin/html/config_pgsql.inc.php
  617.   echo "\$SLISUSER=\"slis\";" >> /home/hadmin/html/config_pgsql.inc.php
  618.   echo "\$PGSQL_SERVER=\"127.0.0.1\";" >> /home/hadmin/html/config_pgsql.inc.php
  619.   echo "\$BASE_HADMIN=\"hadmin\";" >> /home/hadmin/html/config_pgsql.inc.php
  620.   echo "\$BASE_DHCP=\"dhcp\";" >> /home/hadmin/html/config_pgsql.inc.php
  621.   echo "\$BASE_SLIS=\"slis\";" >> /home/hadmin/html/config_pgsql.inc.php
  622.   echo "?>" >> /home/hadmin/html/config_pgsql.inc.php  
  623.  
  624.   # Fichier de conf pour perl
  625.   echo "\$POSTGRESPASS=\"$POSTGRESPASS\";" > /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
  626.   echo "\$POSTGRESUSER=\"postgres\";" >> /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
  627.   echo "\$ADMINPASS=\"$ADMINPASS\";" >> /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
  628.   echo "\$ADMINUSER=\"hadmin\";" >> /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
  629.   echo "\$SLISPASS=\"$SLISPASS\";" >> /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
  630.   echo "\$SLISUSER=\"slis\";" >> /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
  631.   echo "\$PGSQL_SERVER=\"127.0.0.1\";" >> /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
  632.   echo "\$BASE_HADMIN=\"hadmin\";" >> /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
  633.   echo "\$BASE_DHCP=\"dhcp\";" >> /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
  634.   echo "\$BASE_SLIS=\"slis\";" >> /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
  635.  
  636.   # Fichier de conf pour le php des utilisateurs
  637.   echo "<?php" > /home/httpd/html/config_pgsql.inc.php
  638.   echo "\$PGSQL_PASS=\"$SLISPASS\";" >> /home/httpd/html/config_pgsql.inc.php
  639.   echo "\$PGSQL_USER=\"slis\";" >> /home/httpd/html/config_pgsql.inc.php
  640.   echo "\$PGSQL_SERVER=\"127.0.0.1\";" >> /home/httpd/html/config_pgsql.inc.php
  641.   echo "\$PGSQL_BASE=\"slis\";" >> /home/httpd/html/config_pgsql.inc.php
  642.   echo "?>" >> /home/httpd/html/config_pgsql.inc.php  
  643.  
  644.   # Securite sur ces fichiers de config
  645.   chmod 750 /home/hadmin/html/config_pgsql.inc.php
  646.   chown hadmin.hadmin /home/hadmin/html/config_pgsql.inc.php
  647.   chmod 750 /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
  648.   chown hadmin.hadmin /home/hadmin/cgi-bin/base/config_pgsql.inc.pl
  649.   chmod 750 /home/httpd/html/config_pgsql.inc.php
  650.   chown nobody.nobody /home/httpd/html/config_pgsql.inc.php
  651.  
  652.   # Premier demarrage de postgres
  653.   /etc/rc.d/init.d/postgresql start
  654.  
  655.   # Config du boot
  656.   /sbin/chkconfig --add postgresql
  657.  
  658.   # Appel du script d'init qui tourne sous postgres
  659.   su - postgres -c "$SLIS_BINDIR/init_pgsql.sh $POSTGRESPASS $ADMINPASS $SLISPASS> /dev/null"
  660.   rm -rf /tmp/dhcp.dump
  661.  
  662.   touch $UPDDIR/CS-6
  663.   logger -t "$LOGTAG" "UPDATE CS-6 effectuee"   
  664. fi
  665. ###
  666.  
  667. ############################################################################
  668. ### Mise a jour CS-7 - 05/12/2000
  669. # Installation de l'interface d'administration dhcp
  670. # Rend obsolete :
  671. ############################################################################
  672.  
  673. if [ ! \( -e $UPDDIR/CS-7 \) ]
  674. then
  675.   # Telechargement du tar
  676.   cd /tmp
  677.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-CS-7.tgz .
  678.   cd /
  679.   tar zxf /tmp/upd-CS-7.tgz
  680.   RC=$?
  681.  
  682.   # Verification et fin de la MAJ
  683.   if [ $RC = 0 ]
  684.   then
  685.     touch $UPDDIR/CS-7
  686.     logger -t "$LOGTAG" "Update CS-7 effectuee."
  687.   else
  688.     logger -t "$LOGTAG" "Update CS-7 ECHEC."
  689.   fi
  690. fi
  691. ###
  692.  
  693. ############################################################################
  694. ### Mise a jour CS-8 - 07/12/2000
  695. # Installation de phppgadmin
  696. # Rend obsolete :
  697. ############################################################################
  698.  
  699. if [ ! \( -e $UPDDIR/CS-8 \) ]
  700. then
  701.   # Telechargement du tar
  702.   cd /tmp
  703.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-CS-8.tgz .
  704.   cd /
  705.   tar zxf /tmp/upd-CS-8.tgz
  706.   RC=$?
  707.  
  708.   # Verification et fin de la MAJ
  709.   if [ $RC = 0 ]
  710.   then
  711.     touch $UPDDIR/CS-8
  712.     logger -t "$LOGTAG" "Update CS-8 effectuee."
  713.   else
  714.     logger -t "$LOGTAG" "Update CS-8 ECHEC."
  715.   fi
  716. fi
  717. ###
  718.  
  719. ############################################################################
  720. ### Mise a jour CS-9 - 07/12/2000
  721. # Patch pour supprimmer postgres des users affichΘs
  722. # Rend obsolete :
  723. ############################################################################
  724.  
  725. if [ ! \( -e $UPDDIR/CS-9 \) ]
  726. then
  727.   # Telechargement du tar
  728.   cd /tmp
  729.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-CS-9.tgz .
  730.   cd /
  731.   tar zxf /tmp/upd-CS-9.tgz
  732.   RC=$?
  733.  
  734.   # Verification et fin de la MAJ
  735.   if [ $RC = 0 ]
  736.   then
  737.     touch $UPDDIR/CS-9
  738.     logger -t "$LOGTAG" "Update CS-9 effectuee."
  739.   else
  740.     logger -t "$LOGTAG" "Update CS-9 ECHEC."
  741.   fi
  742. fi
  743. ###
  744.  
  745. ############################################################################
  746. ### Mise a jour CS-10 - 12/12/2000
  747. # MAJ de l'interface dhcp
  748. # Rend obsolete :
  749. ############################################################################
  750.  
  751. if [ ! \( -e $UPDDIR/CS-10 \) ]
  752. then
  753.   # Telechargement du tar
  754.   cd /tmp
  755.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-CS-10.tgz .
  756.   cd /
  757.   tar zxf /tmp/upd-CS-10.tgz
  758.   RC=$?
  759.  
  760.   # Verification et fin de la MAJ
  761.   if [ $RC = 0 ]
  762.   then
  763.     touch $UPDDIR/CS-10
  764.     logger -t "$LOGTAG" "Update CS-10 effectuee."
  765.   else
  766.     logger -t "$LOGTAG" "Update CS-10 ECHEC."
  767.   fi
  768. fi
  769. ###
  770.  
  771. ############################################################################
  772. ### Mise a jour 2.0-19 - 05/12/2000
  773. # MAJ d'arpwatch
  774. # Rend obsolete :
  775. ############################################################################
  776.  
  777. if [ ! \( -e $UPDDIR/2.0-19 \) ]
  778. then
  779.   # Telech
  780.   cd /tmp
  781.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/arpwatch-2.1a4-29slis.i386.rpm .
  782.  
  783.   # Desinstall de l'ancienne version (non slis)
  784.   rpm -e arpwatch
  785.  
  786.   # Install du rpm pour slis
  787.   rpm -i arpwatch-2.1a4-29slis.i386.rpm
  788.  
  789.   # Ajout d'un lien (le RPM provient de RH 7.0)
  790.   ln -fs /etc/rc.d/init.d /etc/init.d
  791.  
  792.   # Verif et fin MAJ
  793.   rpm -q arpwatch-2.1a4-29slis 2>/dev/null >/dev/null
  794.   if [ $? = 0 ]
  795.   then
  796.     echo "local6.*                    /var/log/arpwatch" >> /etc/syslog.conf
  797.     killall -HUP syslogd
  798.     touch $UPDDIR/2.0-19
  799.     logger -t "$LOGTAG" "Update 2.0-19 effectuee."
  800.   else
  801.     logger -t "$LOGTAG" "Update 2.0-19 ECHEC."
  802.   fi
  803. fi
  804. ###
  805.  
  806. ############################################################################
  807. ### Mise a jour 2.0-20 - 05/12/2000
  808. # Conf de logrotate pour syslog
  809. # Rend obsolete :
  810. ############################################################################
  811.  
  812. if [ ! \( -e $UPDDIR/2.0-20 \) ]
  813. then
  814.   echo "
  815. /var/log/arpwatch {
  816.   postrotate
  817.     /usr/bin/killall -HUP syslogd
  818.   endscript
  819. }
  820.  
  821. /var/log/slis {
  822.   postrotate
  823.     /usr/bin/killall -HUP syslogd
  824.   endscript
  825. }
  826.  
  827. /var/log/diald {
  828.   postrotate
  829.     /usr/bin/killall -HUP syslogd
  830.   endscript
  831. }
  832. " >> /etc/logrotate.d/syslog
  833.     touch $UPDDIR/2.0-20
  834.     logger -t "$LOGTAG" "Update 2.0-20 effectuee."
  835. fi
  836. ###
  837.  
  838.  
  839. ############################################################################
  840. ### Mise a jour 2.0-21 - 10/12/2000
  841. # Nouveaux menus "fonction avancees"
  842. # Rend obsolete : Les fichiers correspondant dans upd-CS-8.tgz
  843. ############################################################################
  844.  
  845. if [ ! \( -e $UPDDIR/2.0-21 \) ]
  846. then
  847.  
  848.   # Telechargement du tar
  849.   cd /tmp
  850.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.0-21.tgz .
  851.   cd /
  852.   tar zxf /tmp/upd-2.0-21.tgz
  853.   RC=$?
  854.  
  855.   # Verification et fin de la MAJ
  856.   if [ $RC = 0 ]
  857.   then
  858.     touch $UPDDIR/2.0-21
  859.     logger -t "$LOGTAG" "Update 2.0-21 effectuee."
  860.   else
  861.     logger -t "$LOGTAG" "Update 2.0-21 ECHEC."
  862.   fi
  863. fi
  864. ###
  865.  
  866. ############################################################################
  867. ### Mise a jour 2.0-22 - 05/12/2000
  868. # MAJ d'arpwatch
  869. # Rend obsolete : Une partie de 2.0-19
  870. ############################################################################
  871.  
  872. # Remarque: Si vous voulez utiliser arpwatch, vous pouvez le lancer a partir
  873. # de votre script academique. Par defaut, Arpwatch n'est pas lance. Cela
  874. # releve d'un choix academique.
  875.  
  876. if [ ! \( -e $UPDDIR/2.0-22 \) ]
  877. then
  878.   # Telech
  879.   cd /tmp
  880.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/arpwatch-2.1a4-29slisA.i386.rpm .
  881.  
  882.   # Install du rpm pour slis
  883.   rpm -U arpwatch-2.1a4-29slisA.i386.rpm
  884.  
  885.   # Verif et fin MAJ
  886.   rpm -q arpwatch-2.1a4-29slisA 2>/dev/null >/dev/null
  887.   if [ $? = 0 ]
  888.   then
  889.     touch $UPDDIR/2.0-22
  890.     logger -t "$LOGTAG" "Update 2.0-22 effectuee."
  891.   else
  892.     logger -t "$LOGTAG" "Update 2.0-22 ECHEC."
  893.   fi
  894. fi
  895. ###
  896.  
  897. ############################################################################
  898. ### Mise a jour CS-11 - 15/12/2000
  899. # Patch de l'interface dhcp
  900. # Rend obsolete :
  901. ############################################################################
  902.  
  903. if [ ! \( -e $UPDDIR/CS-11 \) ]
  904. then
  905.   # Telechargement du tar
  906.   cd /tmp
  907.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-CS-11.tgz .
  908.   cd /
  909.   tar zxf /tmp/upd-CS-11.tgz
  910.   RC=$?
  911.  
  912.   chown root.root /tmp
  913.   chmod 777 /tmp
  914.   chmod +t /tmp
  915.  
  916.   # Verification et fin de la MAJ
  917.   if [ $RC = 0 ]
  918.   then
  919.     touch $UPDDIR/CS-11
  920.     logger -t "$LOGTAG" "Update CS-11 effectuee."
  921.   else
  922.     logger -t "$LOGTAG" "Update CS-11 ECHEC."
  923.   fi
  924. fi
  925. ###
  926.  
  927. ############################################################################
  928. ### Mise a jour 2.0-23 - 17/01/2001
  929. # Installation des modules perl DBI et DBD::Pg
  930. # Rend obsolete :
  931. ############################################################################
  932.  
  933. if [ ! \( -e $UPDDIR/2.0-23 \) ]
  934. then
  935.  
  936.   cd /tmp
  937.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/DBI-1.13-1.i386.rpm .
  938.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/DBD-Pg-SLIS.tgz .
  939.   rpm -U DBI-1.13-1.i386.rpm
  940.   cd /
  941.   tar zxf /tmp/DBD-Pg-SLIS.tgz
  942.   RC=$?
  943.  
  944.   # Verifications
  945.   rpm -q DBI 2>/dev/null >/dev/null
  946.   if [ $? = 0 -a $RC = 0 ]
  947.   then
  948.     touch $UPDDIR/2.0-23
  949.     logger -t "$LOGTAG" "UPDATE 2.0-23 effectuee"
  950.   else
  951.     logger -t "$LOGTAG" "UPDATE 2.0-23 ECHEC."
  952.   fi
  953. fi
  954. ###
  955.  
  956. ############################################################################
  957. ### Mise a jour 2.0-24b - 01/02/2001
  958. # SECURITE BIND
  959. # Rend obsolete : 2.0-24
  960. ############################################################################
  961.  
  962. if [ ! \( -e $UPDDIR/2.0-24b \) ]
  963. then
  964.  
  965.   cd /tmp
  966.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/bind-8.2.3-0.6.x.i386.rpm .
  967.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/bind-utils-8.2.3-0.6.x.i386.rpm .
  968.   rpm -U bind-8.2.3-0.6.x.i386.rpm
  969.   rpm -U bind-utils-8.2.3-0.6.x.i386.rpm
  970.  
  971.   # Verifications
  972.   rpm -q bind-utils-8.2.3 2>/dev/null >/dev/null
  973.   RC=$?
  974.   rpm -q bind-8.2.3 2>/dev/null >/dev/null
  975.   if [ $? = 0 -a $RC = 0 ]
  976.   then
  977.     /etc/rc.d/init.d/named restart
  978.     touch $UPDDIR/2.0-24b
  979.     logger -t "$LOGTAG" "UPDATE 2.0-24b effectuee"
  980.   else
  981.     logger -t "$LOGTAG" "UPDATE 2.0-24b ECHEC."
  982.   fi
  983. fi
  984. ###
  985.  
  986. ############################################################################
  987. ### Mise a jour 2.0-25 - 22/01/2001
  988. # SECURITE MODUTILS
  989. # Rend obsolete :
  990. ############################################################################
  991.  
  992. if [ ! \( -e $UPDDIR/2.0-25 \) ]
  993. then
  994.  
  995.   cd /tmp
  996.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/modutils-2.3.21-0.6.2.i386.rpm .
  997.   rpm -U modutils-2.3.21-0.6.2.i386.rpm
  998.  
  999.   # Verifications
  1000.   rpm -q modutils-2.3.21 2>/dev/null >/dev/null
  1001.   RC=$?
  1002.   if [ $RC = 0 ]
  1003.   then
  1004.     touch $UPDDIR/2.0-25
  1005.     logger -t "$LOGTAG" "UPDATE 2.0-25 effectuee"
  1006.   else
  1007.     logger -t "$LOGTAG" "UPDATE 2.0-25 ECHEC."
  1008.   fi
  1009. fi
  1010. ###
  1011.  
  1012. ############################################################################
  1013. ### Mise a jour 2.0-26 - 29/01/2001
  1014. # Installation de xntpd
  1015. # Rend obsolete :
  1016. ############################################################################
  1017.  
  1018. if [ ! \( -e $UPDDIR/2.0-26 \) ]
  1019. then
  1020.  
  1021.   cd /tmp
  1022.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/xntp3-5.93-14.i386.rpm .
  1023.   rpm -U xntp3-5.93-14.i386.rpm
  1024.  
  1025.   # Verifications et fin de l'install
  1026.   rpm -q xntp3-5.93-14 2>/dev/null >/dev/null
  1027.   RC=$?
  1028.   if [ $RC = 0 ]
  1029.   then
  1030.     /sbin/chkconfig --add xntpd
  1031.     /etc/rc.d/init.d/xntpd start
  1032.     touch $UPDDIR/2.0-26
  1033.     logger -t "$LOGTAG" "UPDATE 2.0-26 effectuee"
  1034.   else
  1035.     logger -t "$LOGTAG" "UPDATE 2.0-26 ECHEC."
  1036.   fi
  1037. fi
  1038. ###
  1039.  
  1040. ############################################################################
  1041. ### Mise a jour 2.0-27 - 20/01/2001
  1042. # Interface de configuration de l'onduleur
  1043. # Rend obsolete :
  1044. ############################################################################
  1045.  
  1046. if [ ! \( -e $UPDDIR/2.0-27 \) ]
  1047. then
  1048.  
  1049.   # Si on ne tue pas mgeupsd, alors le tar va echouer
  1050.   killall mgeupsd
  1051.  
  1052.   # Telechargement du tar
  1053.   cd /tmp
  1054.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.0-27.tgz .
  1055.   cd /
  1056.   tar zxf /tmp/upd-2.0-27.tgz
  1057.   RC=$?
  1058.  
  1059.   # Verification et fin de la MAJ
  1060.   if [ $RC = 0 ]
  1061.   then
  1062.     touch $UPDDIR/2.0-27
  1063.     logger -t "$LOGTAG" "Update 2.0-27 effectuee."
  1064.   else
  1065.     logger -t "$LOGTAG" "Update 2.0-27 ECHEC."
  1066.   fi
  1067. fi
  1068. ###
  1069.  
  1070. ############################################################################
  1071. ### Mise a jour CS-12 - 01/02/2001
  1072. # Amelioration des fonctions de filtrage d'url
  1073. # Rend obsolete :
  1074. ############################################################################
  1075.  
  1076. if [ ! \( -e $UPDDIR/CS-12 \) ]
  1077. then
  1078.   # Telechargement du tar
  1079.   cd /tmp
  1080.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-CS-12.tgz .
  1081.   cd /
  1082.   tar zxf /tmp/upd-CS-12.tgz
  1083.   RC=$?
  1084.  
  1085.   # Verification et fin de la MAJ
  1086.   if [ $RC = 0 ]
  1087.   then
  1088.     touch $UPDDIR/CS-12
  1089.     logger -t "$LOGTAG" "Update CS-12 effectuee."
  1090.   else
  1091.     logger -t "$LOGTAG" "Update CS-12 ECHEC."
  1092.   fi
  1093. fi
  1094. ###
  1095.  
  1096. ############################################################################
  1097. ### Mise a jour 2.0-28 - 05/02/2001
  1098. # Installation d'openldap et necessaires
  1099. # Rend obsolete :
  1100. ############################################################################
  1101.  
  1102. if [ ! \( -e $UPDDIR/2.0-28 \) ]
  1103. then
  1104.  
  1105.   cd /tmp
  1106.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openldap-1.2.11-15.i386.rpm .
  1107.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openldap-servers-1.2.11-15.i386.rpm .
  1108.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/perl-MIME-Base64-2.11-6.i386.rpm .
  1109.   rpm -U --nodeps openldap-1.2.11-15.i386.rpm
  1110.   rpm -U openldap-servers-1.2.11-15.i386.rpm
  1111.   rpm -U perl-MIME-Base64-2.11-6.i386.rpm
  1112.   ln -sf /etc/rc.d/init.d /etc/init.d
  1113.  
  1114.   # Verifications et fin de la MAJ
  1115.   rpm -q openldap-servers-1.2.11-15 2>/dev/null >/dev/null
  1116.   RC1=$?
  1117.   rpm -q perl-MIME-Base64-2.11-6 2>/dev/null >/dev/null
  1118.   RC2=$?
  1119.   if [ $RC1 = 0 -a $RC2 = 0 ]
  1120.   then
  1121.     # Fabrication du slapd.conf initial
  1122.     ROOTPASSWD=`grep "^root:" /etc/shadow|awk -F: '{print $2}'`
  1123.     HOST_OU=`cat /etc/HOSTNAME |cut -d. -f1`
  1124.     DOMAIN_OU=`cat /etc/HOSTNAME |cut -d. -f2`
  1125.     BASE_LDAP="ou=education, o=gouv, c=fr"
  1126.     echo "
  1127. include         /etc/openldap/slapd.at.conf
  1128. include         /etc/openldap/slapd.oc.conf
  1129. schemacheck     off
  1130. pidfile         /var/run/slapd.pid
  1131. argsfile        /var/run/slapd.args
  1132.  
  1133. database        ldbm
  1134. suffix          \"ou=$HOST_OU, ou=slis, ou=$DOMAIN_OU, $BASE_LDAP\"
  1135. rootdn          \"cn=slismaster, ou=$HOST_OU, ou=slis, ou=$DOMAIN_OU, $BASE_LDAP\"
  1136. rootpw          {crypt}$ROOTPASSWD
  1137. directory       /var/lib/ldap
  1138.  
  1139. defaultaccess read
  1140. access to attr=userpassword
  1141.         by dn=\"uid=ldap,ou=$HOST_OU,ou=slis,ou=$DOMAIN_OU,$BASE_LDAP\" read
  1142.     by self read
  1143.     by dn=\".*\" none
  1144. " > /etc/openldap/slapd.conf
  1145.     
  1146.     /sbin/chkconfig --add ldap
  1147.     /etc/rc.d/init.d/ldap start
  1148.     touch $UPDDIR/2.0-28
  1149.     logger -t "$LOGTAG" "UPDATE 2.0-28 effectuee"
  1150.   else
  1151.     logger -t "$LOGTAG" "UPDATE 2.0-28 ECHEC."
  1152.   fi
  1153. fi
  1154. ###
  1155.  
  1156. ############################################################################
  1157. ### Mise a jour CS-13 - 17/04/2001 10/05/2001
  1158. # Nouvelle interface de gestion - premiere mouture
  1159. # Rend obsolete :
  1160. ############################################################################
  1161.  
  1162. if [ ! \( -e $UPDDIR/CS-13 \) ]
  1163. then
  1164.   # Telechargement du tar
  1165.   cd /tmp
  1166.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-CS-13.tgz .
  1167.   cd /
  1168.   tar zxf /tmp/upd-CS-13.tgz
  1169.   RC=$?
  1170.  
  1171.   # Initialisation de la base SQL hadmin
  1172.   export PGPASSWORD=`grep ADMINPASS /home/hadmin/html/config_pgsql.inc.php |cut -d\" -f2`
  1173.   export PGUSER="hadmin"
  1174.   psql hadmin < /tmp/hadmin.sql
  1175.   RC2=$?
  1176.  
  1177.   # Verification et fin de la MAJ
  1178.   if [ $RC = 0 -a $RC2 = 0 ]
  1179.   then
  1180.  
  1181.     # Remise en etat des droits
  1182.     bash /usr/local/sbin/permslis
  1183.  
  1184.     # Recuperation des anciens comptes et stockage dans la base
  1185.     /usr/local/sbin/passwd2sql
  1186.  
  1187.     # Recuperation des anciennes donnes de connection pour stockage dans la base
  1188.     export LANG="C"
  1189.     /usr/local/sbin/old_isdnlog_2sql
  1190.  
  1191.     # Initialisation des logs squid et apache
  1192.     /usr/local/sbin/accesslog2sql /var/log/httpd/access_log.4 apache
  1193.     /usr/local/sbin/accesslog2sql /var/log/httpd/access_log.3 apache
  1194.     /usr/local/sbin/accesslog2sql /var/log/httpd/access_log.2 apache
  1195.     /usr/local/sbin/accesslog2sql /var/log/httpd/access_log.1 apache
  1196.     /usr/local/sbin/accesslog2sql /var/log/httpd/access_log apache
  1197.     /usr/local/sbin/accesslog2sql /usr/local/squid/logs/access.log.1 squid
  1198.     /bin/gzip -d -c /usr/local/squid/logs/access.log.0.gz > /usr/local/squid/logs/access.log.0 
  1199.     /usr/local/sbin/accesslog2sql /usr/local/squid/logs/access.log.0 squid
  1200.     rm -f /usr/local/squid/logs/access.log.0
  1201.  
  1202.     # Lancement de connslogd au demarrage
  1203.     sed "s/etrnd/connslogd/" /etc/rc.d/rc.local > /tmp/rc.local
  1204.     cp -f /etc/rc.d/rc.local /etc/rc.d/rc.local.CS-13
  1205.     cp -f /tmp/rc.local /etc/rc.d/rc.local
  1206.     chmod 755 /etc/rc.d/rc.local
  1207.     if [ -f /etc/adsl ]
  1208.     then
  1209.       echo "/usr/local/sbin/connslogd&" >> /etc/rc.d/rc.local
  1210.     fi
  1211.     killall etrnd
  1212.     /usr/local/sbin/connslogd&
  1213.  
  1214.     # Programmation de la crontab (ajout de accesslog2sql et supp de etrnd_refresh)
  1215.     /usr/bin/crontab -l |grep -v etrnd > /tmp/cron
  1216.     echo "0 12,18,21,0,7 * * *    /usr/local/sbin/accesslog2sql /usr/local/squid/logs/access.log squid" >> /tmp/cron
  1217.     echo "0 13,19,22,1,8 * * *    /usr/local/sbin/accesslog2sql /var/log/httpd/access_log apache" >> /tmp/cron
  1218.     /usr/bin/crontab /tmp/cron
  1219.  
  1220.     # Script de correction du bug des comptes depassant 8 caracteres
  1221.     perl /usr/local/sbin/old_bug8_workaround
  1222.  
  1223.     # Creation des users systeme
  1224.     /usr/local/sbin/init_sysusers
  1225.  
  1226.     # Creation du rep applis CyberEcole
  1227.     mkdir /home/cyberecole/applis
  1228.     chmod 775 /home/cyberecole/applis
  1229.     chown smbadmin.profs /home/cyberecole/applis 2>/dev/null
  1230.  
  1231.     # Importation CyberEcole
  1232.     if [ "$CYBERECOLE" = "1" ]
  1233.     then
  1234.       /usr/local/sbin/old_cyberecole_2sql
  1235.     fi
  1236.  
  1237.     # Remise en etat des droits
  1238.     bash /usr/local/sbin/permslis
  1239.  
  1240.     touch $UPDDIR/CS-13
  1241.     logger -t "$LOGTAG" "Update CS-13 effectuee."
  1242.   else
  1243.     logger -t "$LOGTAG" "Update CS-13 ECHEC."
  1244.   fi
  1245. fi
  1246. ###
  1247.  
  1248. ############################################################################
  1249. ### Mise a jour 2.0-30 - 08/03/2001
  1250. # Nouveau mknamedconf (essentiellement ameliorations pour version ADSL et cable)
  1251. # et daemon dns_autoconf qui verifie la conf DNS en permanence
  1252. # Rend obsolete: 2.0-2, 2.0-4
  1253. ############################################################################
  1254.  
  1255. # MAJ desactivee car ne concerne que des SLIS experimentaux et le nouveau
  1256. # script de conf du DNS sera deploye dans les 2.1
  1257.    
  1258. #if [ ! \( -e $UPDDIR/2.0-30 \) ]
  1259. #then
  1260.  
  1261.   # Telechargement du tar
  1262. #  cd /tmp
  1263. #  rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.0-30.tgz .
  1264. #  cd /
  1265. #  tar zxf /tmp/upd-2.0-30.tgz
  1266. #  RC=$?
  1267.  
  1268.   # Verification et fin de la MAJ
  1269. #  if [ $RC = 0 ]
  1270. #  then
  1271. #    deja=`grep dns_autoconf /etc/rc.d/rc.local`
  1272. #    if [ "$deja" = "" ]
  1273. #    then
  1274. #      echo >> /etc/rc.d/rc.local
  1275. #      echo "# Surveillance de la conf DNS" >> /etc/rc.d/rc.local
  1276. #      echo "/usr/local/sbin/dns_autoconf &" >> /etc/rc.d/rc.local
  1277. #    fi
  1278. #    /usr/local/sbin/dns_autoconf &
  1279. #    touch $UPDDIR/2.0-30
  1280. #    logger -t "$LOGTAG" "Update 2.0-30 effectuee."
  1281. #  else
  1282. #    logger -t "$LOGTAG" "Update 2.0-30 ECHEC."
  1283. #  fi
  1284. #fi
  1285. ###
  1286.  
  1287. ############################################################################
  1288. ### Mise a jour 2.0-31 - 21/03/2001
  1289. # Amelioration routage_net_on/off (rapiditΘ et adsl) et modification du
  1290. # message de l'interface "pas de proxy pour" qui prete a confusion.
  1291. # Rend obsolete :
  1292. ############################################################################
  1293.  
  1294. if [ ! \( -e $UPDDIR/2.0-31 \) ]
  1295. then
  1296.   # Telechargement du tar
  1297.   cd /tmp
  1298.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.0-31.tgz .
  1299.   cd /
  1300.   tar zxf /tmp/upd-2.0-31.tgz
  1301.   RC=$?
  1302.  
  1303.   # Verification et fin de la MAJ
  1304.   if [ $RC = 0 ]
  1305.   then
  1306.     touch $UPDDIR/2.0-31
  1307.     logger -t "$LOGTAG" "Update 2.0-31 effectuee."
  1308.   else
  1309.     logger -t "$LOGTAG" "Update 2.0-31 ECHEC."
  1310.   fi
  1311. fi
  1312. ###
  1313.  
  1314. ############################################################################
  1315. ### Mise a jour CS-13c - 16/05/2001
  1316. # Deplacement de /var/lib/pgsql dans /home/pgsql
  1317. # car plus assez de place dans /var
  1318. ############################################################################
  1319.  
  1320. if [ ! \( -e $UPDDIR/CS-13c \) ]
  1321. then
  1322.   
  1323.   # Test au cas ou ce serai deja fait
  1324.   if [ ! \( -e /home/pgsql \) ]
  1325.   then
  1326.  
  1327.     # Arret de postgres
  1328.     /etc/rc.d/init.d/postgresql stop
  1329.     sleep 20
  1330.     /etc/rc.d/init.d/postgresql stop
  1331.     sleep 20
  1332.     killall postmaster 2>/dev/null
  1333.     killall -9 postmaster 2>/dev/null
  1334.     /sbin/fuser -kn tcp 5432  
  1335.  
  1336.     # Deplacement des fichiers
  1337.     mv /var/lib/pgsql /var/lib/pgsql.old
  1338.     mkdir /home/pgsql
  1339.     cp -a /var/lib/pgsql.old/* /home/pgsql
  1340.     ln -s /home/pgsql /var/lib/pgsql
  1341.     rm -rf /var/lib/pgsql.old
  1342.  
  1343.     # Redemarrage de postgres
  1344.     /etc/rc.d/init.d/postgresql start
  1345.  
  1346.   fi
  1347.  
  1348.   touch $UPDDIR/CS-13c
  1349.   logger -t "$LOGTAG" "Update CS-13c"
  1350. fi
  1351. ###
  1352.  
  1353.  
  1354. ########################################################################
  1355. ### Mise a jour 2.0-32 - 16/05/2001
  1356. # Installation d'IMP et de Wordwiew
  1357. # Patch de la nouvelle interface, correction de bugs
  1358. # Rend obsolete :
  1359. ########################################################################
  1360.  
  1361. if [ ! \( -e $UPDDIR/2.0-32 \) ]
  1362. then
  1363.  
  1364.   cd /tmp
  1365.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/mswordview-0.5.2-1.i386.rpm .
  1366.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.0-32.tgz .
  1367.   rpm -U mswordview-0.5.2-1.i386.rpm
  1368.   rpm -q mswordview-0.5.2-1 2>/dev/null>/dev/null
  1369.   RC1=$?
  1370.   cd /
  1371.   tar xfz /tmp/upd-2.0-32.tgz
  1372.   RC2=$?
  1373.   
  1374. if [ $RC1 = 0 -a $RC2 = 0 ]
  1375.   then
  1376.  
  1377.   # CrΘation du compte hordemgr et de la base Horde
  1378.     HORDEPASS=`$SLIS_BINDIR/pspg`
  1379.  
  1380.   # Mot de passe postgres 
  1381.    export PGPASSWORD=`grep POSTGRESPASS /home/hadmin/html/config_pgsql.inc.php| cut -d\" -f2`
  1382.    export PGUSER=postgres
  1383.  
  1384.   # CrΘation user horde
  1385.    psql template1 -tqc "drop user hordemgr" > /dev/null 2>/dev/null
  1386.    psql template1 -tqc "create user hordemgr with password '$HORDEPASS' nocreatedb nocreateuser"
  1387.  
  1388.   # crΘation base Horde
  1389.    psql template1 -tqc "drop database horde" > /dev/null 2>/dev/null
  1390.    psql template1 -tqc "create database horde"
  1391.  
  1392.   # crΘation tables IMP
  1393.    psql  horde < /tmp/horde.sql
  1394.    
  1395.   # Sauve HORDEPASS dans config_pgsql.inc.php des utilisateurs
  1396.    mv /home/httpd/html/config_pgsql.inc.php /home/httpd/html/config_pgsql.inc.php.old
  1397.     sed "s/?>//" /home/httpd/html/config_pgsql.inc.php.old > /home/httpd/html/config_pgsql.inc.php   
  1398.     echo "\$HORDEPASS=\"$HORDEPASS\";" >> /home/httpd/html/config_pgsql.inc.php
  1399.     echo "\$HORDEUSER=\"hordemgr\";" >> /home/httpd/html/config_pgsql.inc.php    
  1400.     echo "\$HOSTNAME=\"$HOSTNAME\";" >> /home/httpd/html/config_pgsql.inc.php
  1401.     echo "?>" >> /home/httpd/html/config_pgsql.inc.php
  1402.    rm -f /home/httpd/html/config_pgsql.inc.php.old 
  1403.  
  1404.   # On indique le mot de passe de Horde dans les fichiers local.inc et db_pgsql.inc    
  1405.    sed "s/XXXHORDEPASSXXX/$HORDEPASS/" /usr/share/php/local.inc.dist > /usr/share/php/local.inc
  1406.    sed "s/XXXHORDEPASSXXX/$HORDEPASS/" /usr/share/php/db_pgsql.inc.dist > /usr/share/php/db_pgsql.inc    
  1407.  
  1408.   # On remplace le lien sur l'interface des utilisateurs dans index.html
  1409.     mv /home/httpd/html/index.html /home/httpd/html/index.old
  1410.     sed "s/<a.*href=\/cgi-bin\/webmail.*/<a href=\/horde\/imp\/index.php3>/" /home/httpd/html/index.old > /home/httpd/html/index.html   
  1411.  
  1412.   # Un petit coup de relecture de HTTPD     
  1413.     killall -HUP httpd     
  1414.  
  1415.   # Retablissement du webmaster (ancien bug de process_web)
  1416.   webmaster=`ls -ld /home/httpd/html/intranet |awk '{print $3}'`
  1417.   if [ "$webmaster" != "" ]
  1418.   then
  1419.     echo "$webmaster" > $BASE/webmaster
  1420.   fi  
  1421.  
  1422.   # Remise en etat des droits
  1423.     /usr/local/sbin/permslis
  1424.  
  1425.   # Conclusion
  1426.    touch $UPDDIR/2.0-32
  1427.    logger -t "$LOGTAG" "UPDATE 2.0-32 effectuee."
  1428.    else
  1429.        logger -t "$LOGTAG" "UPDATE 2.0-32 ECHEC."
  1430.    fi
  1431. fi
  1432. ###   
  1433.  
  1434. ############################################################################
  1435. ### Mise a jour 2.0-33 - 21/05/2001
  1436. # Correction bug de process_web par rapport a horde
  1437. # Rend obsolete :
  1438. ############################################################################
  1439.  
  1440. if [ ! \( -e $UPDDIR/2.0-33 \) ]
  1441. then
  1442.   # Telechargement du tar
  1443.   cd /usr/local/sbin
  1444.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/process_web .
  1445.   RC=$?
  1446.  
  1447.   # Verification et fin de la MAJ
  1448.   if [ $RC = 0 ]
  1449.   then
  1450.     /usr/local/sbin/permslis
  1451.     touch $UPDDIR/2.0-33
  1452.     logger -t "$LOGTAG" "Update 2.0-33 effectuee."
  1453.   else
  1454.     logger -t "$LOGTAG" "Update 2.0-33 ECHEC."
  1455.   fi
  1456. fi
  1457. ###
  1458.  
  1459. ############################################################################
  1460. ### Mise a jour 2.0-34 - 22/05/2001
  1461. # Redemarrage de connslogd necessaire a cause de CS-13c
  1462. # Rend obsolete :
  1463. ############################################################################
  1464.  
  1465. if [ ! \( -e $UPDDIR/2.0-34 \) ]
  1466. then
  1467.   killall connslogd
  1468.   sleep 3
  1469.   killall -9 connslogd 2>/dev/null
  1470.   sleep 3
  1471.   /usr/local/sbin/connslogd&
  1472.  
  1473.   touch $UPDDIR/2.0-34
  1474.   logger -t "$LOGTAG" "Update 2.0-34 effectuee."
  1475. fi
  1476. ###
  1477.  
  1478. ############################################################################
  1479. ### Mise a jour 2.0-35 - 06/06/2001
  1480. # Config specifique des libs php pour Horde (correction de bug)
  1481. # Rend obsolete :
  1482. ############################################################################
  1483.  
  1484. if [ ! \( -e $UPDDIR/2.0-35 \) ]
  1485. then
  1486.  
  1487.   echo "
  1488.   # Added for Horde
  1489.   <Directory /home/httpd/html/horde>
  1490.       Options Indexes FollowSymLinks
  1491.       AllowOverride None
  1492.       order allow,deny
  1493.       allow from all
  1494.       <IfModule mod_php3.c>
  1495.           php3_include_path '/usr/share/php:.'
  1496.           php3_auto_prepend_file /usr/share/php/prepend.php3
  1497.           php3_magic_quotes_gpc Off
  1498.           php3_track_vars On
  1499.       </IfModule>
  1500.       <IfModule mod_php4.c>
  1501.           php_value include_path '/usr/share/php:.'
  1502.           php_value auto_prepend_file /usr/share/php/prepend.php3
  1503.           php_flag magic_quotes_gpc Off
  1504.           php_flag track_vars On
  1505.       </IfModule>
  1506.   </Directory>
  1507. " >> /etc/httpd/conf/httpd.conf
  1508.   
  1509.   sed "s/auto_prepend_file/#auto_prepend_file/" /etc/php.ini > /tmp/php.ini
  1510.   cp -f /etc/php.ini /etc/php.ini.upd-2.0-35
  1511.   mv -f /tmp/php.ini /etc/php.ini
  1512.   killall -HUP httpd
  1513.  
  1514.   touch $UPDDIR/2.0-35
  1515.   logger -t "$LOGTAG" "Update 2.0-35 effectuee."
  1516. fi
  1517. ###
  1518.  
  1519. ############################################################################
  1520. ### Mise a jour 2.0-36 - 08/06/2001
  1521. # Correction du bug du primary group
  1522. # Rend obsolete :
  1523. ############################################################################
  1524.  
  1525. if [ ! \( -e $UPDDIR/2.0-36 \) ]
  1526. then
  1527.   # Telechargement du tar
  1528.   cd /tmp
  1529.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.0-36.tgz .
  1530.   cd /
  1531.   tar zxf /tmp/upd-2.0-36.tgz
  1532.   RC=$?
  1533.  
  1534.   # Revalidation des groupes
  1535.   export PGPASSWORD=`grep ADMINPASS /home/hadmin/html/config_pgsql.inc.php |cut -d\" -f2`
  1536.   export PGUSER="hadmin"
  1537.   /usr/local/sbin/permslis
  1538.   psql hadmin -tqc "update groups set tovalid='true'"
  1539.   /usr/local/sbin/valid
  1540.  
  1541.   # Verification et fin de la MAJ
  1542.   if [ $RC = 0 ]
  1543.   then
  1544.     touch $UPDDIR/2.0-36
  1545.     logger -t "$LOGTAG" "Update 2.0-36 done."
  1546.   else
  1547.     logger -t "$LOGTAG" "Update 2.0-36 FAILED."
  1548.   fi
  1549. fi
  1550. ###
  1551.  
  1552. ############################################################################
  1553. ### Mise a jour 2.0-37 - 18/06/2001
  1554. # NOUVEAU SYSTEME DE FILTRAGE IP (FORWARD ET FIREWALL)
  1555. # Rend obsolete :
  1556. ############################################################################
  1557.  
  1558. if [ ! \( -e $UPDDIR/2.0-37 \) ]
  1559. then
  1560.  
  1561.   # Les variables dont il est question ci-dessous manquent dans 2.0
  1562.   # Elles font partie du script d'install des SLIS 2.1
  1563.  
  1564.   # Creation de la variable ALLOWED_SMTP a partir des valeurs codees
  1565.   # en dur dans process_filtrage_ip (ce script est d'ailleurs devenu obsolete)
  1566.   R=$RANDOM
  1567.   egrep "SMTP\w=" /usr/local/sbin/process_filtrage_ip > /tmp/smtp.$R
  1568.   ALLOWED_SMTP=`awk -F\" -v ORS="," '{ print $2; }' /tmp/smtp.$R |sed "s/,$//"`
  1569.   echo "ALLOWED_SMTP=\"$ALLOWED_SMTP\"" >> /home/hadmin/slis.conf
  1570.   echo "\$ALLOWED_SMTP=\"$ALLOWED_SMTP\";" >> /home/hadmin/slis.conf.pl
  1571.   echo "<?PHP \$ALLOWED_SMTP=\"$ALLOWED_SMTP\"; ?>" >> /home/hadmin/slis.conf.php
  1572.   rm -f /tmp/smtp.$R
  1573.  
  1574.   # Creation des variables ADMIN_NET et ADMIN_NET_MASK
  1575.   # Elles definissent le reseau depuis lequel le meta-administrateur
  1576.   # maintient les SLIS.
  1577.   # Arbitrairement, on prend le reseau de classe C correspondant au smarthost
  1578.   ADMIN_NET=`ipcalc --network $SMART_HOST_IP --netmask 255.255.255.0 |grep NETWORK|cut -d= -f2`
  1579.   echo "ADMIN_NET=\"$ADMIN_NET\"" >> /home/hadmin/slis.conf
  1580.   echo "ADMIN_NET_MASK=\"255.255.255.0\"" >> /home/hadmin/slis.conf
  1581.   echo "\$ADMIN_NET=\"$ADMIN_NET\";" >> /home/hadmin/slis.conf.pl
  1582.   echo "\$ADMIN_NET_MASK=\"255.255.255.0\";" >> /home/hadmin/slis.conf.pl
  1583.   echo "<?PHP \$ADMIN_NET=\"$ADMIN_NET\"; ?>" >> /home/hadmin/slis.conf.php
  1584.   echo "<?PHP \$ADMIN_NET_MASK=\"255.255.255.0\"; ?>" >> /home/hadmin/slis.conf.php
  1585.   
  1586.   # Telechargement du tar
  1587.   cd /tmp
  1588.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.0-37.tgz .
  1589.   cd /
  1590.   tar zxf /tmp/upd-2.0-37.tgz
  1591.   RC=$?
  1592.  
  1593.   # Lancement
  1594.   /usr/local/sbin/permslis
  1595.   /usr/local/sbin/mkfilters
  1596.   cp -u /home/hadmin/cgi-bin/base/subnets /home/hadmin/cgi-bin/queue/subnets
  1597.   /usr/local/sbin/process_subnets
  1598.  
  1599.   MAIL_ADMIN=`awk '{if (NR==3) print}' $BASE/params_admin.txt`
  1600.   if [ "$MAIL_ADMIN" != "" ]
  1601.   then
  1602.   echo "
  1603.   Le systeme de filtrage IP (routage et pare-feu) de votre SLIS vient de
  1604.   changer. Le routage et le pare-feu ont ete regles de maniere optimale.
  1605.   Cependant, si vous aviez eu besoin de changer le niveau de securite IP,
  1606.   nous vous invitons a le refaire, dans les fonctions avancees, rubrique
  1607.   Securite (filtrage ip).
  1608.   " | mail -s "Information mise a jour" $MAIL_ADMIN
  1609.   fi
  1610.  
  1611.   # Verification et fin de la MAJ
  1612.   if [ $RC = 0 ]
  1613.   then
  1614.     touch $UPDDIR/2.0-37
  1615.     logger -t "$LOGTAG" "Update 2.0-37 done."
  1616.   else
  1617.     logger -t "$LOGTAG" "Update 2.0-37 FAILED."
  1618.   fi
  1619. fi
  1620. ###
  1621.  
  1622. ############################################################################
  1623. ### Mise a jour 2.0-38 - 19/06/2001
  1624. # Bug de l'implementation de horde dans /webmail
  1625. # Rend obsolete :
  1626. ############################################################################
  1627.  
  1628. if [ ! \( -e $UPDDIR/2.0-38 \) ]
  1629. then
  1630.  
  1631.   echo "
  1632.   # Added for Horde
  1633.   <Directory /home/httpd/html/webmail>
  1634.       Options Indexes FollowSymLinks
  1635.       AllowOverride None
  1636.       order allow,deny
  1637.       allow from all
  1638.       <IfModule mod_php3.c>
  1639.           php3_include_path '/usr/share/php:.'
  1640.           php3_auto_prepend_file /usr/share/php/prepend.php3
  1641.           php3_magic_quotes_gpc Off
  1642.           php3_track_vars On
  1643.       </IfModule>
  1644.       <IfModule mod_php4.c>
  1645.           php_value include_path '/usr/share/php:.'
  1646.           php_value auto_prepend_file /usr/share/php/prepend.php3
  1647.           php_flag magic_quotes_gpc Off
  1648.           php_flag track_vars On
  1649.       </IfModule>
  1650.   </Directory>
  1651. " >> /etc/httpd/conf/httpd.conf
  1652.   
  1653.   killall -HUP httpd
  1654.  
  1655.   touch $UPDDIR/2.0-38
  1656.   logger -t "$LOGTAG" "Update 2.0-38 effectuee."
  1657. fi
  1658. ###
  1659.  
  1660. ############################################################################
  1661. ### Mise a jour 2.0-39 - 06/07/2001
  1662. # Fix for bug somewhere before...
  1663. # The table containing subnets disapeared (hadmin)
  1664. # The file /home/hadmin/cgi-bin/base/subnets is empty...
  1665. # Rend obsolete :
  1666. ############################################################################
  1667.  
  1668. if [ ! \( -e $UPDDIR/2.0-39 \) ]
  1669. then
  1670.  
  1671.   /usr/local/sbin/mksubnets
  1672.   rm -f /home/hadmin/cgi-bin/queue/subnets
  1673.  
  1674.   touch $UPDDIR/2.0-39
  1675.   logger -t "$LOGTAG" "Update 2.0-39 effectuee."
  1676. fi
  1677. ###
  1678.  
  1679.  
  1680. ############################################################################
  1681. ### Mise a jour 2.0-40 - 26/09/2001
  1682. # Secu updates and bug corrections from RedHat:
  1683. # - Secu: fetchmail is updated if fetchmail option is activated, removed else
  1684. # - Bug corrected in tmpwatch package
  1685. # - Secu: Sendmail local exploit bug corrected
  1686. # - Secu: Man local exploit corrected (mktemp package also upgraded)
  1687. # Rend obsolete :
  1688. ############################################################################
  1689.  
  1690. if [ ! \( -e $UPDDIR/2.0-40 \) ]
  1691. then
  1692.  
  1693.   cd /tmp
  1694.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/tmpwatch-2.8-0.6.x.i386.rpm .
  1695.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/sendmail-8.11.6-1.6.x.i386.rpm .
  1696.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/mktemp-1.5-2.1.6x.i386.rpm .
  1697.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/man-1.5i2-0.6x.5.i386.rpm .
  1698.   rpm -U tmpwatch-2.8-0.6.x.i386.rpm
  1699.   rpm -U sendmail-8.11.6-1.6.x.i386.rpm
  1700.   rpm -U mktemp-1.5-2.1.6x.i386.rpm
  1701.   rpm -U man-1.5i2-0.6x.5.i386.rpm
  1702.  
  1703.   RC1=0
  1704.   . /home/hadmin/setup.data
  1705.   if [ "$FETCHMAIL" = "1" ]
  1706.   then
  1707.     rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/fetchmail-5.9.0-0.6.2.i386.rpm .
  1708.     rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openssl-0.9.5a-7.6.x.i386.rpm .
  1709.     rpm -U fetchmail-5.9.0-0.6.2.i386.rpm
  1710.     rpm -U openssl-0.9.5a-7.6.x.i386.rpm
  1711.     rpm -q fetchmail-5.9.0-0.6.2 2>/dev/null >/dev/null
  1712.     RC1=$?
  1713.   else
  1714.     rpm -e fetchmail
  1715.   fi
  1716.  
  1717.   # Verifications et fin de l'install
  1718.   rpm -q tmpwatch-2.8-0.6.x 2>/dev/null >/dev/null
  1719.   RC2=$?
  1720.   rpm -q sendmail-8.11.6-1.6.x 2>/dev/null >/dev/null
  1721.   RC3=$?
  1722.   rpm -q man-1.5i2-0.6x.5 2>/dev/null >/dev/null
  1723.   RC4=$?
  1724.   
  1725.   if [ $RC1 = 0 -a $RC2 = 0 -a $RC3 = 0 -a $RC4 = 0 ]
  1726.   then
  1727.     /etc/rc.d/init.d/sendmail restart
  1728.     touch $UPDDIR/2.0-40
  1729.     logger -t "$LOGTAG" "UPDATE 2.0-40 effectuee"
  1730.   else
  1731.     logger -t "$LOGTAG" "UPDATE 2.0-40 ECHEC."
  1732.   fi
  1733. fi
  1734. ###
  1735.  
  1736. ############################################################################
  1737. ### UPDATE 2.x-41 - 03/10/2001
  1738. # - Installation of a new http interface designed for the users (called clientgw)
  1739. # This interface has only got for the moment a gateway for changing passwords.
  1740. # It runs on port 2000 under the same uid of hadmin. This update installs
  1741. # the config files for the new httpd daemon that will be running.
  1742. # Obsoletes :
  1743. ############################################################################
  1744.  
  1745. if [ ! \( -e $UPDDIR/2.x-41 \) ]
  1746. then
  1747.   # Download and install
  1748.   cd /tmp
  1749.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-41.tgz .
  1750.   cd /
  1751.   tar zxf /tmp/upd-2.x-41.tgz
  1752.   RC=$?
  1753.  
  1754.   # Check and finish
  1755.   if [ $RC = 0 ]
  1756.   then
  1757.     ln -s /usr/lib/apache /etc/hadmin/clientgw/modules
  1758.     echo "# Client gateway" >> /etc/rc.d/rc.local
  1759.     echo "export PHPRC="/etc/hadmin";/usr/sbin/httpd -f /etc/hadmin/clientgw/conf/httpd.conf;export -n PHPRC" >> /etc/rc.d/rc.local
  1760.     echo "/usr/local/sbin/cg-admind&" >> /etc/rc.d/rc.local
  1761.     export PHPRC="/etc/hadmin";/usr/sbin/httpd -f /etc/hadmin/clientgw/conf/httpd.conf;export -n PHPRC
  1762.     /usr/local/sbin/cg-admind&
  1763.     /usr/local/sbin/permslis
  1764.     touch $UPDDIR/2.x-41
  1765.     logger -t "$LOGTAG" "Update 2.x-41 done."
  1766.   else
  1767.     logger -t "$LOGTAG" "Update 2.x-41 FAILED."
  1768.   fi
  1769. fi
  1770. ###
  1771.  
  1772. ############################################################################
  1773. ### Update 2.0-42 - 10/10/2001
  1774. # Restore system
  1775. # Obsoletes :
  1776. ############################################################################
  1777.  
  1778. if [ ! \( -e $UPDDIR/2.0-42 \) ]
  1779. then
  1780.   # Download
  1781.   cd /tmp
  1782.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-42.tgz .
  1783.   tar zxf upd-2.x-42.tgz --directory /
  1784.   RC=$?
  1785.  
  1786.   # Creating tmp dir
  1787.   mkdir -p /home/hadmin/tmp
  1788.   chown hadmin.hadmin /home/hadmin/tmp
  1789.   chmod 700 /home/hadmin/tmp
  1790.  
  1791.   # patching php.ini
  1792.   patch /etc/hadmin/php.ini << EOF
  1793. 208c208
  1794. < post_max_size        =    8M        ; Maximum size of POST data that PHP will accept.
  1795. ---
  1796. > post_max_size        =    100M        ; Maximum size of POST data that PHP will accept.
  1797. 245c245
  1798. < upload_max_filesize = 2M            ; Maximum allowed size for uploaded files
  1799. ---
  1800. > upload_max_filesize = 100M            ; Maximum allowed size for uploaded files
  1801. EOF
  1802.   killall -HUP httpd
  1803.  
  1804.   # Check and finish
  1805.   if [ $RC = 0 ]
  1806.   then
  1807.     touch $UPDDIR/2.0-42
  1808.     logger -t "$LOGTAG" "Update 2.0-42 Done."
  1809.   else
  1810.     logger -t "$LOGTAG" "Update 2.0-42 FAILED."
  1811.   fi
  1812. fi
  1813. ###
  1814.  
  1815. ############################################################################
  1816. ### Update 2.x-43 - 09/11/2001
  1817. # Synchro with CVS. Numerous bug fixes and enhancements.
  1818. # THIS UPDATE IS A BIG ONE!
  1819. # Obsoletes :
  1820. ############################################################################
  1821.  
  1822. if [ ! \( -e $UPDDIR/2.x-43 \) ]
  1823. then
  1824.  
  1825.   # Download the update
  1826.   cd /tmp
  1827.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-43.tgz .
  1828.   
  1829.   # Kill connslogd and cg-admind as they will be replaced by the update
  1830.   killall connslogd 2>/dev/null
  1831.   killall cg-admind 2>/dev/null
  1832.   
  1833.   # If this SLIS has a dns_autoconf daemon running, kill it and set a flag
  1834.   DNS=`ps awux |grep dns_autoconf |grep -v grep |wc -l`
  1835.   if [ $DNS = 1 ]
  1836.   then
  1837.     killall dns_autoconf
  1838.   fi
  1839.  
  1840.   # Untar the core update file
  1841.   tar zxf upd-2.x-43.tgz --directory /
  1842.   RC=$?
  1843.  
  1844.   # A missing directory (not important)
  1845.   # It's only a place to put some slis files like *.sql
  1846.   mkdir -p /var/lib/slis
  1847.  
  1848.   # Reset the permissions
  1849.   bash /usr/local/sbin/permslis
  1850.  
  1851.   # Restart the previously killed daemons
  1852.   /usr/local/sbin/connslogd&
  1853.   /usr/local/sbin/cg-admind&
  1854.   if [ $DNS = 1 ]
  1855.   then
  1856.     /usr/local/sbin/dns_autoconf&
  1857.   fi
  1858.  
  1859.   # Continue the update only if untaring was successfull
  1860.   if [ $RC = 0 ]
  1861.   then
  1862.  
  1863.     # Usefull denied_url file in squid conf was removed by error on some 2.1 versions
  1864.     # This file may be used to add some URL to deny in a hurry. It mustn't be
  1865.     # empty, so we add some Xs into it.
  1866.     if [ ! -f /usr/local/squid/etc/denied_url ]
  1867.     then 
  1868.       echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" > /usr/local/squid/etc/denied_url
  1869.     fi
  1870.  
  1871.     # Bug fix for mail header visualization function into hadmin
  1872.     /usr/sbin/usermod -G mail hadmin
  1873.     killall -HUP httpd 
  1874.     
  1875.     # Refresh squid config file (2.1 only)
  1876.     if [ "`cat /etc/version_slis_num`" = "2.1" ]
  1877.     then
  1878.       /usr/local/sbin/mksquidconf
  1879.     fi
  1880.         
  1881.     # Errors from accesslog2sql are not important, so we redirect 
  1882.     # output to /dev/null
  1883.     R=$RANDOM
  1884.     crontab -l > /tmp/cron.$R
  1885.     ALREADY=`grep "access.log squid >" /tmp/cron.$R`
  1886.     if [ "$ALREADY" = "" ]
  1887.     then 
  1888.       sed "s;access.log squid;access.log squid > /dev/null 2>/dev/null;" /tmp/cron.$R > /tmp/cron.new.$R
  1889.       sed "s;access_log apache;access_log apache > /dev/null 2>/dev/null;" /tmp/cron.new.$R > /tmp/cron.$R
  1890.       crontab /tmp/cron.$R
  1891.     fi
  1892.  
  1893.     # New subnets activation and schedule subsystem
  1894.       # Init of SQL tables and conversion of old schedules
  1895.     /usr/local/sbin/old_schedules_2sql 2>/dev/null >/dev/null
  1896.       # Crontab modifications
  1897.     R=$RANDOM
  1898.     crontab -l > /tmp/cron.$R
  1899.     grep -v routage_net_o /tmp/cron.$R | grep -v Horaires > /tmp/cron.new.$R
  1900.     grep -v "DO NOT EDIT" /tmp/cron.new.$R | grep -v "installed on " | grep -v "Cron version" > /tmp/cron.$R
  1901.     echo "# Subnets schedules" >> /tmp/cron.$R
  1902.     echo "* * * * *       /usr/local/sbin/process_subnets.cron" >> /tmp/cron.$R
  1903.     crontab /tmp/cron.$R
  1904.       # Init scripts update
  1905.     grep -v "/usr/local/sbin/process_subnets" /etc/rc.d/rc.local | \
  1906.     grep -v "cp -u /home/hadmin/cgi-bin/base/subnet" | \
  1907.     grep -v "RunCache" > /tmp/rc.local.$R
  1908.     if [ -s /tmp/rc.local.$R ]
  1909.     then
  1910.       cp -f /etc/rc.d/rc.local /etc/rc.d/rc.local.2.x-43
  1911.       mv -f /tmp/rc.local.$R /etc/rc.d/rc.local
  1912.     fi
  1913.     chmod 755 /etc/rc.d/rc.local
  1914.     echo "rm -f /var/lock/process_subnets*" >> /etc/rc.d/rc.local
  1915.     . /home/hadmin/setup.data
  1916.     if [ "PROXYON" != "0" ]
  1917.     then
  1918.       /sbin/chkconfig --add runcache
  1919.       /sbin/chkconfig runcache on
  1920.     fi
  1921.  
  1922.     # Refresh ip filters (new mkfilters script)
  1923.     /usr/local/sbin/mkfilters
  1924.  
  1925.     # Create a new database for a french application (B2i)
  1926.     export PGPASSWORD=`grep PGSQL_PASS /home/httpd/html/config_pgsql.inc.php|cut -d\" -f2`
  1927.     export PGUSER=`grep PGSQL_USER /home/httpd/html/config_pgsql.inc.php|cut -d\" -f2`
  1928.     psql -tqc "create database b2i"
  1929.  
  1930.     # Change the owner of "slis" database (little bug fix)
  1931.     export PGPASSWORD=`grep POSTGRESPASS /home/hadmin/html/config_pgsql.inc.php|cut -d\" -f2`
  1932.     export PGUSER=`grep POSTGRESUSER /home/hadmin/html/config_pgsql.inc.php|cut -d\" -f2`
  1933.     psql -tqc "update pg_database set datdba = (select usesysid from pg_user where usename = 'slis') where datname = 'slis';" template1
  1934.  
  1935.     # Send a mail to admin
  1936.     MAIL_ADMIN=`awk '{if (NR==3) print}' $BASE/params_admin.txt`
  1937.     if [ "$MAIL_ADMIN" != "" ]
  1938.     then
  1939.     echo "
  1940.  
  1941. Message envoye automatiquement par votre SLIS.
  1942.  
  1943. Votre SLIS vient d'etre mis a jour.
  1944. Le systeme de gestion d'horaires par sous-reseaux a 
  1945. completement change. Un script a converti vos anciens
  1946. horaires dans le nouveau systeme, mais nous vous
  1947. invitons a verifier que tout est en ordre dans les
  1948. fonctions avancees, "acces par sous-reseaux/horaires".
  1949.  
  1950.  "  | mail -s "Mise a jour SLIS" $MAIL_ADMIN
  1951.     fi
  1952.  
  1953.     touch $UPDDIR/2.x-43
  1954.     logger -t "$LOGTAG" "Update 2.x-43 Done."
  1955.   else
  1956.     logger -t "$LOGTAG" "Update 2.x-43 FAILED."
  1957.   fi
  1958. fi
  1959.  
  1960. ############################################################################
  1961. ### Update 2.x-43b - 04/12/2001
  1962. # Big bug fix!
  1963. # /etc/named.acls was not correctly updated by process_subnets.cron resulting
  1964. # in some SLIS refusing DNS queries.
  1965. # Obsoletes :
  1966. ############################################################################
  1967.  
  1968. if [ ! \( -e $UPDDIR/2.x-43b \) ]
  1969. then
  1970.  
  1971.   # Download the update
  1972.   cd /tmp
  1973.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-43b.tgz .
  1974.  
  1975.   # Untaring
  1976.   tar zxf upd-2.x-43b.tgz --directory /
  1977.   RC=$?
  1978.   /usr/local/sbin/permslis
  1979.  
  1980.   # Check and finish
  1981.   if [ $RC = 0 ]
  1982.   then
  1983.     touch $UPDDIR/2.x-43b
  1984.     logger -t "$LOGTAG" "Update 2.x-43b Done."
  1985.   else
  1986.     logger -t "$LOGTAG" "Update 2.x-43b FAILED."
  1987.   fi
  1988. fi
  1989. ###
  1990.  
  1991. ############################################################################
  1992. ### Update 2.0-44 - 21/12/2001
  1993. # SECURITY PATCHES
  1994. # Obsoletes :
  1995. ############################################################################
  1996.  
  1997. if [ ! \( -e $UPDDIR/2.0-44 \) ]
  1998. then
  1999.  
  2000.   # Download the files
  2001.   cd /tmp
  2002.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/wu-ftpd-2.6.1-0.6x.21.i386.rpm .
  2003.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/diffutils-2.7-22.6x.i386.rpm .
  2004. #  rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/ucd-snmp-4.2.1-4.6.x.i386.rpm .
  2005. #  rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/ucd-snmp-utils-4.2.1-4.6.x.i386.rpm .
  2006.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/apache-1.3.22-0.6.i386.rpm .
  2007.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/db3-3.1.17-4.6x.i386.rpm .
  2008.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openssl-0.9.5a-7.6.x.i386.rpm .
  2009.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/rpm-4.0.2-6x.i386.rpm .
  2010.  
  2011.  
  2012.   # Do the things...
  2013.   rpm -e samba-client 2>/dev/null
  2014.   rpm -e rpm -e ghostscript rhs-printfilters ghostscript-fonts 2>/dev/null
  2015.   rpm -e lpr 2>/dev/null
  2016.   rpm -U diffutils-2.7-22.6x.i386.rpm
  2017.   RC1=$?
  2018.   rpm -U openssl-0.9.5a-7.6.x.i386.rpm db3-3.1.17-4.6x.i386.rpm rpm-4.0.2-6x.i386.rpm
  2019.   RC1b=$?
  2020. #  rpm -U ucd-snmp-4.2.1-4.6.x.i386.rpm ucd-snmp-utils-4.2.1-4.6.x.i386.rpm 
  2021. #  RC2=$?
  2022.   rpm -U wu-ftpd-2.6.1-0.6x.21.i386.rpm
  2023.   RC3=$?
  2024.   rpm -U apache-1.3.22-0.6.i386.rpm
  2025.   RC4=$?
  2026.  
  2027.   # Check and finish
  2028.   if [ $RC1 = 0 -a $RC1b = 0 -a $RC3 = 0 -a $RC4 = 0 ]
  2029.   then
  2030.  
  2031.     # Httpd restarting
  2032.     /etc/rc.d/init.d/httpd stop
  2033.     killall httpd
  2034.     sleep 5
  2035.     /etc/rc.d/init.d/httpd start
  2036.     export PHPRC="/etc/hadmin";/usr/sbin/httpd -f /etc/hadmin/conf/httpd.conf;export -n PHPRC
  2037.     export PHPRC=/etc/hadmin;/usr/sbin/httpd -f /etc/hadmin/clientgw/conf/httpd.conf;export -n PHPRC
  2038.  
  2039.     touch $UPDDIR/2.0-44
  2040.     logger -t "$LOGTAG" "Update 2.0-44 Done."
  2041.   else
  2042.     logger -t "$LOGTAG" "Update 2.0-44 FAILED."
  2043.   fi
  2044. fi
  2045. ###
  2046.  
  2047. ############################################################################
  2048. ### Update 2.x-45 - 21/12/2001
  2049. # OpenSSH installation
  2050. # Obsoletes :
  2051. ############################################################################
  2052.  
  2053. if [ ! \( -e $UPDDIR/2.x-45 \) ]
  2054. then
  2055.  
  2056.   # Download the files
  2057.   cd /tmp
  2058.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openssh-3.0.2p1-1.i386.rpm .
  2059.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openssh-server-3.0.2p1-1.i386.rpm .
  2060.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openssh-clients-3.0.2p1-1.i386.rpm .
  2061.  
  2062.   # Do the things...
  2063.   rpm -U openssh-3.0.2p1-1.i386.rpm openssh-clients-3.0.2p1-1.i386.rpm openssh-server-3.0.2p1-1.i386.rpm 2>/dev/null
  2064.   rpm -q openssh-server >/dev/null
  2065.   RC1=$?
  2066.  
  2067.   # Check and finish
  2068.   if [ $RC1 = 0 ]
  2069.   then
  2070.  
  2071.     /sbin/chkconfig --add sshd
  2072.     /sbin/chkconfig sshd on
  2073.     killall sshd 2>/dev/null
  2074.     killall ssfd 2>/dev/null
  2075.     sleep 3
  2076.     killall -9 sshd 2>/dev/null
  2077.     killall -9 ssfd 2>/dev/null
  2078.  
  2079.     /etc/rc.d/init.d/sshd start
  2080.     sleep 3
  2081.     /etc/rc.d/init.d/sshd restart # I dont know why, but sshd doesn't start the first time
  2082.  
  2083.     grep -v ssfd /etc/rc.d/rc.local |grep -v sshd > /tmp/rc.local
  2084.     cp -f /etc/rc.d/rc.local /etc/rc.d/rc.local.upd-2.x-45
  2085.     mv -f /tmp/rc.local /etc/rc.d/rc.local
  2086.     chmod 755 /etc/rc.d/rc.local
  2087.  
  2088.     touch $UPDDIR/2.x-45
  2089.     logger -t "$LOGTAG" "Update 2.x-45 Done."
  2090.   else
  2091.     logger -t "$LOGTAG" "Update 2.x-45 FAILED."
  2092.   fi
  2093. fi
  2094. ###
  2095.  
  2096. ############################################################################
  2097. ### Update 2.x-46 - 20/12/2001
  2098. # Enhancements of the php interface
  2099. # Obsoletes :
  2100. ############################################################################
  2101.  
  2102. if [ ! \( -e $UPDDIR/2.x-46 \) ]
  2103. then
  2104.  
  2105.   # Download the update
  2106.   cd /tmp
  2107.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-46.tgz .
  2108.  
  2109.   # Untaring
  2110.   tar zxf upd-2.x-46.tgz --directory /
  2111.   RC=$?
  2112.   /usr/local/sbin/permslis
  2113.  
  2114.   # Check and finish
  2115.   if [ $RC = 0 ]
  2116.   then
  2117.     touch $UPDDIR/2.x-46
  2118.     logger -t "$LOGTAG" "Update 2.x-46 Done."
  2119.   else
  2120.     logger -t "$LOGTAG" "Update 2.x-46 FAILED."
  2121.   fi
  2122. fi
  2123. ###
  2124.  
  2125.  
  2126. ############################################################################
  2127. ### Update 2.x-48 - 22/01/2002
  2128. # Bug fixes and enhancements:
  2129. #  - Bug fix: The sunday, all subnets were deactivated by process_subnets.cron
  2130. #  - interface bugs with some browsers when deleting users
  2131. #  - interface bug accepting some special characters in logins
  2132. #  - permslis bug changing the owner of some files for the webmaster
  2133. #  - optimization of the process_subnets.cron script (no more kil -HUP named
  2134. #    every minute)
  2135. # Security: 
  2136. #    removed pine, wich contains a security hole
  2137. # Obsoletes : 2.x-47
  2138. ############################################################################
  2139.  
  2140. if [ ! \( -e $UPDDIR/2.x-48 \) ]
  2141. then
  2142.  
  2143.   # Download the update
  2144.   cd /tmp
  2145.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-48.tgz .
  2146.  
  2147.   # Untaring
  2148.   tar zxf upd-2.x-48.tgz --directory /
  2149.   RC=$?
  2150.   /usr/local/sbin/permslis
  2151.  
  2152.   # Remove pine
  2153.   rpm -e pine
  2154.  
  2155.   # Check and finish
  2156.   if [ $RC = 0 ]
  2157.   then
  2158.     touch $UPDDIR/2.x-48
  2159.     logger -t "$LOGTAG" "Update 2.x-48 Done."
  2160.   else
  2161.     logger -t "$LOGTAG" "Update 2.x-48 FAILED."
  2162.   fi
  2163. fi
  2164. ###
  2165.  
  2166. ############################################################################
  2167. ### Update 2.x-49 - 23/01/2002
  2168. # Bug fixes for 2.x-48
  2169. # Obsoletes :
  2170. ############################################################################
  2171.  
  2172. if [ ! \( -e $UPDDIR/2.x-49 \) ]
  2173. then
  2174.  
  2175.   # Download the update
  2176.   cd /tmp
  2177.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-49.tgz .
  2178.  
  2179.   # Untaring
  2180.   tar zxf upd-2.x-49.tgz --directory /
  2181.   RC=$?
  2182.   /usr/local/sbin/permslis
  2183.  
  2184.   # Check and finish
  2185.   if [ $RC = 0 ]
  2186.   then
  2187.     touch $UPDDIR/2.x-49
  2188.     logger -t "$LOGTAG" "Update 2.x-49 Done."
  2189.   else
  2190.     logger -t "$LOGTAG" "Update 2.x-49 FAILED."
  2191.   fi
  2192. fi
  2193. ###
  2194.  
  2195. ############################################################################
  2196. ### Update 2.x-50 - 23/01/2002
  2197. # Bug fix: IMP not working because of bad permission on config_pgsl.inc.php
  2198. # Obsoletes :
  2199. ############################################################################
  2200.  
  2201. if [ ! \( -e $UPDDIR/2.x-50 \) ]
  2202. then
  2203.  
  2204.   # Download the update
  2205.   cd /tmp
  2206.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-50.tgz .
  2207.  
  2208.   # Untaring
  2209.   tar zxf upd-2.x-50.tgz --directory /
  2210.   RC=$?
  2211.   /usr/local/sbin/permslis
  2212.  
  2213.   # Check and finish
  2214.   if [ $RC = 0 ]
  2215.   then
  2216.     touch $UPDDIR/2.x-50
  2217.     logger -t "$LOGTAG" "Update 2.x-50 Done."
  2218.   else
  2219.     logger -t "$LOGTAG" "Update 2.x-50 FAILED."
  2220.   fi
  2221. fi
  2222. ###
  2223.  
  2224. ############################################################################
  2225. ### Update 2.x-51 - 28/01/2002
  2226. # SECURITY PATCHES
  2227. # Obsoletes :
  2228. ############################################################################
  2229.  
  2230. if [ ! \( -e $UPDDIR/2.x-51 \) ]
  2231. then
  2232.  
  2233.   # Download the files
  2234.   cd /tmp
  2235. #  rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/at-3.1.8-22.1.i386.rpm .
  2236.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/rsync-2.4.6-1.6.i386.rpm .
  2237.  
  2238.   # Do the things...
  2239. #  rpm -U at-3.1.8-22.1.i386.rpm
  2240. #  RC1=$?
  2241.   rpm -U rsync-2.4.6-1.6.i386.rpm
  2242.   RC2=$?
  2243.  
  2244.   # Check and finish
  2245.   if [ $RC2 = 0 ]
  2246.   then
  2247.  
  2248.     touch $UPDDIR/2.x-51
  2249.     logger -t "$LOGTAG" "Update 2.x-51 Done."
  2250.   else
  2251.     logger -t "$LOGTAG" "Update 2.x-51 FAILED."
  2252.   fi
  2253. fi
  2254. ###
  2255.  
  2256.  
  2257. ############################################################################
  2258. ### Update 2.x-52 - 05/02/2002
  2259. # New function: Restore of a 2.x backup
  2260. # Obsoletes :
  2261. ############################################################################
  2262.  
  2263. if [ ! \( -e $UPDDIR/2.x-52 \) ]
  2264. then
  2265.  
  2266.   # Download the files
  2267.   cd /tmp
  2268.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-52.tgz .
  2269.  
  2270.   # Do the things...
  2271.   tar zxf upd-2.x-52.tgz --directory /
  2272.   RC=$?
  2273.   /usr/local/sbin/permslis
  2274.  
  2275.   # Check and finish
  2276.   if [ $RC = 0 ]
  2277.   then
  2278.  
  2279.     touch $UPDDIR/2.x-52
  2280.     logger -t "$LOGTAG" "Update 2.x-52 Done."
  2281.   else
  2282.     logger -t "$LOGTAG" "Update 2.x-52 FAILED."
  2283.   fi
  2284. fi
  2285. ###
  2286.  
  2287. ############################################################################
  2288. ### Update 2.x-53b - 21/03/2002
  2289. # New logrotate script for samba, fixing the too many logfiles bug
  2290. #  2.x-53 was deleting /var/log/samba/log.smb.1.*
  2291. #  2.x-53b deletes /var/log/samba/log.smb.*.* 
  2292. # Obsoletes : 2.x-53
  2293. ############################################################################
  2294.  
  2295. if [ ! \( -e $UPDDIR/2.x-53b \) ]
  2296. then
  2297.   /usr/sbin/logrotate /etc/logrotate.conf
  2298.  
  2299.   echo "
  2300. /var/log/samba/log.nmb {
  2301.     notifempty
  2302.     missingok
  2303.     postrotate
  2304.         /usr/bin/killall -HUP nmbd
  2305.     endscript
  2306. }
  2307. /var/log/samba/log.smb {
  2308.     notifempty
  2309.     missingok
  2310.     postrotate
  2311.         /usr/bin/killall -HUP smbd
  2312.     endscript
  2313. }
  2314. " > /etc/logrotate.d/samba
  2315.   rm -rf /var/log/samba/log.smb.*.*
  2316.   rm -rf /var/log/samba/log.nmb.*.*
  2317.  
  2318.   grep -v samba /var/lib/logrotate.status  > /tmp/logrotate.status
  2319.   mv -f /tmp/logrotate.status /var/lib/logrotate.status
  2320.   /usr/sbin/logrotate /etc/logrotate.conf
  2321.  
  2322.   touch $UPDDIR/2.x-53b
  2323.   logger -t "$LOGTAG" "Update 2.x-53b Done."
  2324. fi
  2325. ###
  2326.  
  2327. ############################################################################
  2328. ### Update 2.x-54 - 28/02/2002
  2329. # Enhancement: added icmp type time-excedeed allowed through the firewall (mkfilters)
  2330. # Bug fix: the home of the webmaster was deleted if the user was deleted (valid)
  2331. # Obsoletes :
  2332. ############################################################################
  2333.  
  2334. if [ ! \( -e $UPDDIR/2.x-54 \) ]
  2335. then
  2336.  
  2337.   # Download the files
  2338.   cd /tmp
  2339.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-54.tgz .
  2340.  
  2341.   # Do the things...
  2342.   tar zxf upd-2.x-54.tgz --directory /
  2343.   RC=$?
  2344.   /usr/local/sbin/permslis
  2345.  
  2346.   # Check and finish
  2347.   if [ $RC = 0 ]
  2348.   then
  2349.  
  2350.     touch $UPDDIR/2.x-54
  2351.     logger -t "$LOGTAG" "Update 2.x-54 Done."
  2352.   else
  2353.     logger -t "$LOGTAG" "Update 2.x-54 FAILED."
  2354.   fi
  2355. fi
  2356. ###
  2357.  
  2358. ############################################################################
  2359. ### Update 2.x-55 - 08/03/2002
  2360. # SECURITY FIX: php uploads bug
  2361. # ENHANCEMENT: added client support for mysql and ldap in the php module 
  2362. # Obsoletes :
  2363. ############################################################################
  2364.  
  2365. if [ ! \( -e $UPDDIR/2.x-55 \) ]
  2366. then
  2367.  
  2368.   # Download the files
  2369.   cd /tmp
  2370.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/php-4.0.6-1slis2x.i386.rpm .
  2371.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/php-imap-4.0.6-1slis2x.i386.rpm .
  2372.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/php-ldap-4.0.6-1slis2x.i386.rpm .
  2373.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/php-pgsql-4.0.6-1slis2x.i386.rpm .
  2374.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/mysql-3.20.32a-3.i386.rpm .
  2375.  
  2376.   # Do the things...
  2377.   killall httpd
  2378.   rpm -U php-4.0.6-1slis2x.i386.rpm php-imap-4.0.6-1slis2x.i386.rpm php-ldap-4.0.6-1slis2x.i386.rpm php-pgsql-4.0.6-1slis2x.i386.rpm mysql-3.20.32a-3.i386.rpm
  2379.   RC1=$?
  2380.   /etc/rc.d/init.d/httpd start
  2381.   export PHPRC="/etc/hadmin";/usr/sbin/httpd -f /etc/hadmin/conf/httpd.conf;export -n PHPRC
  2382.   export PHPRC=/etc/hadmin;/usr/sbin/httpd -f /etc/hadmin/clientgw/conf/httpd.conf;export -n PHPRC
  2383.   /sbin/chkconfig mysql off
  2384.  
  2385.   # Check and finish
  2386.   if [ $RC1 = 0 ]
  2387.   then
  2388.  
  2389.     touch $UPDDIR/2.x-55
  2390.     logger -t "$LOGTAG" "Update 2.x-55 Done."
  2391.   else
  2392.     logger -t "$LOGTAG" "Update 2.x-55 FAILED."
  2393.   fi
  2394. fi
  2395. ###
  2396.  
  2397. ############################################################################
  2398. ### Update 2.x-57 - 08/03/2002
  2399. # Deletion of /var/lock/process_subnets.cron at boot
  2400. # Obsoletes :
  2401. ############################################################################
  2402.  
  2403. if [ ! \( -e $UPDDIR/2.x-57 \) ]
  2404. then
  2405.     echo "rm -f /var/lock/process_subnets.cron" > /etc/rc.d/rc3.d/S39Lock_cleaning
  2406.     chmod 755 /etc/rc.d/rc3.d/S39Lock_cleaning
  2407.  
  2408.     touch $UPDDIR/2.x-57
  2409.     logger -t "$LOGTAG" "Update 2.x-57 Done."
  2410. fi
  2411. ###
  2412.  
  2413. ############################################################################
  2414. ### Update 2.1-58 - 12/03/2002
  2415. # Bug fix: preg_grep syntax has changed since php 4.0.4
  2416. # Secu: Added a blocking filter to prevent users from login into ADSL alcatel modems by telnet
  2417. # Obsoletes :
  2418. ############################################################################
  2419.  
  2420. if [ ! \( -e $UPDDIR/2.x-58 \) ]
  2421. then
  2422.  
  2423.   # Download the files
  2424.   cd /tmp
  2425.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-58.tgz .
  2426.  
  2427.   # Do the things...
  2428.   tar zxf upd-2.x-58.tgz --directory /
  2429.   RC=$?
  2430.   /usr/local/sbin/permslis
  2431.   /usr/local/sbin/mkfilters
  2432.  
  2433.   # Check and finish
  2434.   if [ $RC = 0 ]
  2435.   then
  2436.  
  2437.     touch $UPDDIR/2.x-58
  2438.     logger -t "$LOGTAG" "Update 2.x-58 Done."
  2439.   else
  2440.     logger -t "$LOGTAG" "Update 2.x-58 FAILED."
  2441.   fi
  2442. fi
  2443. ###
  2444.  
  2445. ############################################################################
  2446. ### Update 2.x-59 - 17/03/2002
  2447. # SECURITY FIX: openssh (http://www.openbsd.org/advisories/ssh_channelalloc.txt)
  2448. # Obsoletes :
  2449. ############################################################################
  2450.  
  2451. if [ ! \( -e $UPDDIR/2.x-59 \) ]
  2452. then
  2453.  
  2454.   # Download the files
  2455.   cd /tmp
  2456.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openssl095a-0.9.5a-9.i386.rpm .
  2457.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openssl-0.9.6-9.i386.rpm .
  2458.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openssh-3.1p1-1.i386.rpm .
  2459.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openssh-clients-3.1p1-1.i386.rpm .
  2460.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openssh-server-3.1p1-1.i386.rpm .
  2461.  
  2462.   # Do the things...
  2463.   rpm -U openssl095a-0.9.5a-9.i386.rpm openssl-0.9.6-9.i386.rpm openssh-3.1p1-1.i386.rpm openssh-clients-3.1p1-1.i386.rpm openssh-server-3.1p1-1.i386.rpm
  2464.   RC1=$?
  2465.   /sbin/chkconfig sshd on
  2466.  
  2467.   # Check and finish
  2468.   if [ $RC1 = 0 ]
  2469.   then
  2470.  
  2471.     touch $UPDDIR/2.x-59
  2472.     logger -t "$LOGTAG" "Update 2.x-59 Done."
  2473.   else
  2474.     logger -t "$LOGTAG" "Update 2.x-59 FAILED."
  2475.   fi
  2476. fi
  2477. ###
  2478.  
  2479. ############################################################################
  2480. ### Update 2.x-60 - 17/03/2002
  2481. # SECURITY UPDATES FROM REDHAT:
  2482. # atd, telnet and ucd-snmp
  2483. # http://www.redhat.com/support/errata/RHSA-2002-015.html
  2484. # http://www.redhat.com/support/errata/RHSA-2001-099.html
  2485. # http://www.redhat.com/support/errata/RHSA-2001-163.html
  2486. # Obsoletes : Some parts of 2.1-44 and 2.x-51
  2487. ############################################################################
  2488.  
  2489. if [ ! \( -e $UPDDIR/2.x-60 \) ]
  2490. then
  2491.  
  2492.   # Download the files
  2493.   cd /tmp
  2494.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/at-3.1.8-22.2.i386.rpm .
  2495.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/telnet-0.17.6x-18.i386.rpm .
  2496.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/ucd-snmp-4.2.3-1.6.x.3.i386.rpm .
  2497.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/ucd-snmp-utils-4.2.3-1.6.x.3.i386.rpm .
  2498.  
  2499.   # Do the things...
  2500.     # telnetd is dangerous and no more usefull now (ssh)
  2501.   rpm -e telnet-server
  2502.     # The updates
  2503.   rpm -F at-3.1.8-22.2.i386.rpm telnet-0.17.6x-18.i386.rpm ucd-snmp-4.2.3-1.6.x.3.i386.rpm ucd-snmp-utils-4.2.3-1.6.x.3.i386.rpm
  2504.   RC1=$?
  2505.  
  2506.   # Check and finish
  2507.   if [ $RC1 = 0 ]
  2508.   then
  2509.  
  2510.     touch $UPDDIR/2.x-60
  2511.     logger -t "$LOGTAG" "Update 2.x-60 Done."
  2512.   else
  2513.     logger -t "$LOGTAG" "Update 2.x-60 FAILED."
  2514.   fi
  2515. fi
  2516. ###
  2517.  
  2518. ############################################################################
  2519. ### Update 2.x-61 - 25/03/2002
  2520. # Squid update (SECURITY)
  2521. # Obsoletes :
  2522. ############################################################################
  2523.  
  2524. if [ ! \( -e $UPDDIR/2.x-61 \) ]
  2525. then
  2526.  
  2527.   # Download the files
  2528.   cd /tmp
  2529.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-61.tgz .
  2530.  
  2531.   # Do the things...
  2532.   /etc/rc.d/init.d/runcache stop
  2533.   sleep 60
  2534.   killall -9 squid 2>/dev/null
  2535.   killall -9 squidGuard 2>/dev/null
  2536.   tar zxf upd-2.x-61.tgz --directory /
  2537.   RC=$?
  2538.   /usr/local/sbin/permslis
  2539.   /etc/rc.d/init.d/runcache start
  2540.  
  2541.   # Check and finish
  2542.   if [ $RC = 0 ]
  2543.   then
  2544.  
  2545.     touch $UPDDIR/2.x-61
  2546.     logger -t "$LOGTAG" "Update 2.x-61 Done."
  2547.   else
  2548.     logger -t "$LOGTAG" "Update 2.x-61 FAILED."
  2549.   fi
  2550. fi
  2551. ###
  2552.  
  2553. ############################################################################
  2554. ### Update 2.x-62 - 25/03/2002
  2555. # SECURITY UPDATE FROM REDHAT:
  2556. # http://www.redhat.com/support/errata/RHSA-2002-026.html
  2557. # Obsoletes :
  2558. ############################################################################
  2559.  
  2560. if [ ! \( -e $UPDDIR/2.x-62 \) ]
  2561. then
  2562.  
  2563.   # Download the files
  2564.   cd /tmp
  2565.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/zlib-1.1.3-25.6.i386.rpm .
  2566.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/rsync-2.4.6-3.6.i386.rpm .
  2567.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/rmt-0.4b19-5.6x.1.i386.rpm .
  2568.  
  2569.   # Do the things...
  2570.   rpm -F zlib-1.1.3-25.6.i386.rpm rsync-2.4.6-3.6.i386.rpm rmt-0.4b19-5.6x.1.i386.rpm
  2571.   RC=$?
  2572.  
  2573.   # Check and finish
  2574.   if [ $RC = 0 ]
  2575.   then
  2576.     touch $UPDDIR/2.x-62
  2577.     logger -t "$LOGTAG" "Update 2.x-62 Done."
  2578.   else
  2579.     logger -t "$LOGTAG" "Update 2.x-62 FAILED."
  2580.   fi
  2581. fi
  2582. ###
  2583.  
  2584. ############################################################################
  2585. ### Update 2.x-63 - 25/03/2002
  2586. # Kernel update
  2587. # !! THIS UPDATE WILL BE DONE ONLY BY NIGHT AS IT IS A KERNEL UPDATE !!
  2588. # !! WHICH WILL REBOOT THE MACHINE                                   !!
  2589. # Obsoletes :
  2590. ############################################################################
  2591.  
  2592. declare -i HOUR
  2593. declare -i R
  2594. HOUR=`date +%k`
  2595. R=$RANDOM
  2596. # "$R -lt 3277" in the following line means that this update
  2597. # will be executed with a probability of 1/10. This is done to
  2598. # prevent an overload of the rsync server.
  2599. # To be sure that all your SLIS are up to date, remove this part
  2600. # of the test in a couple of weeks, commenting this line and
  2601. # commenting out the next one.
  2602. #if [ ! \( -e $UPDDIR/2.x-63 \) -a $HOUR -lt 6 -a $R -lt 3277 ]
  2603. if [ ! \( -e $UPDDIR/2.x-63 \) -a $HOUR -lt 6 ]
  2604. then
  2605.  
  2606.   if [ "`/bin/uname -v|/bin/grep SMP`" = "" ]
  2607.   then
  2608.     SMP=""
  2609.     SMP2=""
  2610.   else
  2611.     SMP="-smp"
  2612.     SMP2="smp"
  2613.   fi
  2614.  
  2615.   PROC=`/bin/uname -m`
  2616.   if [ "$PROC" = "i486" ]
  2617.   then
  2618.     PROC="i386"
  2619.   fi
  2620.  
  2621.   . /home/hadmin/setup.data
  2622.   SMP3=""
  2623.   if [ "$VTUN" = "1" ]
  2624.   then
  2625.     SMP="-smp"
  2626.     SMP2="smp"
  2627.     SMP3="smp"
  2628.   fi
  2629.  
  2630.   RELEASE=`/bin/uname -r |sed s/smp//`
  2631.  
  2632.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/kernel`echo $SMP`-2.2.19-6.2.16.`echo $PROC`.rpm .
  2633.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/mount-2.10r-0.6.x.i386.rpm .
  2634.  
  2635.   /sbin/insmod loop
  2636.   rpm -e kernel-utils 2>/dev/null
  2637.   rpm -F mount-2.10r-0.6.x.i386.rpm
  2638.   rpm -i kernel`echo $SMP`-2.2.19-6.2.16.`echo $PROC`.rpm
  2639.   cd /lib/modules/2.2.19-6.2.16`echo $SMP2`/net
  2640.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/tun.o .
  2641.   RC=$?
  2642.  
  2643.   if [ $RC = 0 ]
  2644.   then
  2645.     /sbin/mkinitrd /boot/initrd-2.2.19-6.2.16.img 2.2.19-6.2.16 2>/dev/null
  2646.     /sbin/mkinitrd /boot/initrd-2.2.19-6.2.16smp.img 2.2.19-6.2.16smp 2>/dev/null
  2647.     sed "s/$RELEASE/2.2.19-6.2.16$SMP3/g" /etc/lilo.conf > /tmp/lilo.conf
  2648.     if [ -s /tmp/lilo.conf ]
  2649.     then
  2650.       mv -f /tmp/lilo.conf /etc/lilo.conf
  2651.       /sbin/lilo
  2652.       rm -f /var/lock/slis_upd*
  2653.       touch $UPDDIR/2.x-63
  2654.       logger -t "$LOGTAG" "Update 2.x-63 Done."
  2655.       /sbin/reboot
  2656.       killall slis_update
  2657.       killall slis_update.dev
  2658.       exit
  2659.     fi
  2660.   else
  2661.     logger -t "$LOGTAG" "Update 2.x-63 FAILED."
  2662.   fi
  2663. fi
  2664. ###
  2665.  
  2666. ############################################################################
  2667. ### Update 2.x-64 - 26/03/2002
  2668. # SECURITY: Horde IMP
  2669. # Obsoletes :
  2670. ############################################################################
  2671.  
  2672. if [ ! \( -e $UPDDIR/2.x-64 \) ]
  2673. then
  2674.  
  2675.   # Download the files
  2676.   cd /tmp
  2677.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-64.tgz .
  2678.  
  2679.   # Do the things...
  2680.   tar zxf upd-2.x-64.tgz --directory /
  2681.   RC=$?
  2682.   /usr/local/sbin/permslis
  2683.  
  2684.   # Check and finish
  2685.   if [ $RC = 0 ]
  2686.   then
  2687.  
  2688.     touch $UPDDIR/2.x-64
  2689.     logger -t "$LOGTAG" "Update 2.x-64 Done."
  2690.   else
  2691.     logger -t "$LOGTAG" "Update 2.x-64 FAILED."
  2692.   fi
  2693. fi
  2694. ###
  2695.  
  2696. ############################################################################
  2697. ### Update 2.x-65 - 27/03/2002
  2698. # Bug fix: process_subnets.cron was not testing the connection to the
  2699. # pgsql server.
  2700. # Obsoletes :
  2701. ############################################################################
  2702.  
  2703. if [ ! \( -e $UPDDIR/2.x-65 \) ]
  2704. then
  2705.  
  2706.   # Download the files
  2707.   cd /tmp
  2708.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-65.tgz .
  2709.  
  2710.   # Do the things...
  2711.   tar zxf upd-2.x-65.tgz --directory /
  2712.   RC=$?
  2713.   /usr/local/sbin/permslis
  2714.  
  2715.   # Check and finish
  2716.   if [ $RC = 0 ]
  2717.   then
  2718.  
  2719.     touch $UPDDIR/2.x-65
  2720.     logger -t "$LOGTAG" "Update 2.x-65 Done."
  2721.   else
  2722.     logger -t "$LOGTAG" "Update 2.x-65 FAILED."
  2723.   fi
  2724. fi
  2725. ###
  2726.  
  2727. ############################################################################
  2728. ### Update 2.x-66 - 03/04/2002
  2729. # Performance optimization: changed squid logs rotation script, replaced
  2730. # prostat by webalizer, optimized accesslog2sql script, reprogrammed
  2731. # crontab.
  2732. # Obsoletes :
  2733. ############################################################################
  2734.  
  2735. if [ ! \( -e $UPDDIR/2.x-66 \) ]
  2736. then
  2737.  
  2738.   # Download the files
  2739.   cd /tmp
  2740.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-66.tgz .
  2741.  
  2742.   # Do the things...
  2743.   tar zxf upd-2.x-66.tgz --directory /
  2744.   RC=$?
  2745.   /usr/local/sbin/permslis
  2746.  
  2747.   # Check and finish
  2748.   if [ $RC = 0 ]
  2749.   then
  2750.  
  2751.     # Crontab edition
  2752.     R=$RANDOM
  2753.     crontab -l |grep -v "access.log squid" | \
  2754.                 grep -v "access_log apache" | \
  2755.                 grep -v "DO NOT EDIT THIS FILE" | \
  2756.                 grep -v "installed on" | \
  2757.                 grep -v "squid_purge" | \
  2758.                 sed "s/Purge squid//" | \
  2759.                 grep -v "Squid rotation/stats calculations" | \
  2760.                 grep -v "Cron version --" > /tmp/cron.$R
  2761.     echo >> /tmp/cron.$R
  2762.     echo "# Access logs rotation, sql storing and stats calculation" >> /tmp/cron.$R
  2763.     echo "30 23 * * *     /usr/local/sbin/squid_rotate > /dev/null 2>/dev/null" >> /tmp/cron.$R
  2764.     echo "30 0 * * *      export LANG=C;/usr/local/sbin/accesslog2sql /var/log/httpd/access_log apache > /dev/null 2>/dev/null" >> /tmp/cron.$R
  2765.     crontab -l > /home/hadmin/updates/cron.2.x-66.bak
  2766.     crontab /tmp/cron.$R
  2767.  
  2768.     # Webalizer installation
  2769.     mkdir /home/hadmin/html/cache_usage
  2770.     if [ "$LANGUAGE" = "french" ]
  2771.     then
  2772.       ln -s /usr/local/sbin/webalizer_french /usr/local/sbin/webalizer
  2773.     else
  2774.       ln -s /usr/local/sbin/webalizer_english /usr/local/sbin/webalizer
  2775.     fi
  2776.  
  2777.     /usr/local/sbin/webalizer
  2778.  
  2779.     # Very little bugfix of a previous update
  2780.     touch /var/log/mysql.log
  2781.  
  2782.     touch $UPDDIR/2.x-66
  2783.     logger -t "$LOGTAG" "Update 2.x-66 Done."
  2784.   else
  2785.     logger -t "$LOGTAG" "Update 2.x-66 FAILED."
  2786.   fi
  2787. fi
  2788. ###
  2789.  
  2790. ############################################################################
  2791. ### Update 2.x-67 - 10/06/2002
  2792. # Bug fix: ADSL was not supported by port redirection function
  2793. # Obsoletes :
  2794. ############################################################################
  2795.  
  2796. if [ ! \( -e $UPDDIR/2.x-67 \) ]
  2797. then
  2798.  
  2799.   # Download the files
  2800.   cd /tmp
  2801.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-67.tgz .
  2802.  
  2803.   # Do the things...
  2804.   tar zxf upd-2.x-67.tgz --directory /
  2805.   RC=$?
  2806.   /usr/local/sbin/permslis
  2807.  
  2808.   # Check and finish
  2809.   if [ $RC = 0 ]
  2810.   then
  2811.  
  2812.     touch $UPDDIR/2.x-67
  2813.     logger -t "$LOGTAG" "Update 2.x-67 Done."
  2814.   else
  2815.     logger -t "$LOGTAG" "Update 2.x-67 FAILED."
  2816.   fi
  2817. fi
  2818. ###
  2819.  
  2820. ############################################################################
  2821. ### Update 2.x-68 - 25/06/2002
  2822. # SECURITY: apache
  2823. # Obsoletes :
  2824. ############################################################################
  2825.  
  2826. if [ ! \( -e $UPDDIR/2.x-68 \) ]
  2827. then
  2828.  
  2829.   # Download the files
  2830.   cd /tmp
  2831.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/apache-1.3.22-5.6.i386.rpm .
  2832.  
  2833.   # Do the things...
  2834.   rpm -U apache-1.3.22-5.6.i386.rpm
  2835.   RC=$?
  2836.  
  2837.   # Check and finish
  2838.   if [ $RC = 0 ]
  2839.   then
  2840.     touch $UPDDIR/2.x-68
  2841.     # Httpd restarting
  2842.     /etc/rc.d/init.d/httpd stop
  2843.     killall httpd
  2844.     sleep 5
  2845.     export PHPRC="/etc"
  2846.     /etc/rc.d/init.d/httpd start
  2847.     export PHPRC="/etc/hadmin";/usr/sbin/httpd -f /etc/hadmin/conf/httpd.conf;export -n PHPRC
  2848.     export PHPRC="/etc/hadmin";/usr/sbin/httpd -f /etc/hadmin/clientgw/conf/httpd.conf;export -n PHPRC
  2849.     logger -t "$LOGTAG" "Update 2.x-68 Done."
  2850.   else
  2851.     logger -t "$LOGTAG" "Update 2.x-68 FAILED."
  2852.   fi
  2853. fi
  2854. ###
  2855.  
  2856. ############################################################################
  2857. ### Update 2.x-69 - 25/06/2002
  2858. # SECURITY: imap, fetchmail
  2859. # Obsoletes :
  2860. ############################################################################
  2861.  
  2862. if [ ! \( -e $UPDDIR/2.x-69 \) ]
  2863. then
  2864.  
  2865.   # Download the files
  2866.   cd /tmp
  2867.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/imap-2001a-1.62.0.i386.rpm .
  2868.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/fetchmail-5.9.0-9.i386.rpm .
  2869.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/tcpdump-3.6.2-11.6.2.0.i386.rpm .
  2870.  
  2871.   # Do the things...
  2872.   rpm -U fetchmail-5.9.0-9.i386.rpm imap-2001a-1.62.0.i386.rpm tcpdump-3.6.2-11.6.2.0.i386.rpm
  2873.   RC=$?
  2874.  
  2875.   # Check and finish
  2876.   if [ $RC = 0 ]
  2877.   then
  2878.     touch $UPDDIR/2.x-69
  2879.     logger -t "$LOGTAG" "Update 2.x-69 Done."
  2880.   else
  2881.     logger -t "$LOGTAG" "Update 2.x-69 FAILED."
  2882.   fi
  2883. fi
  2884. ###
  2885.  
  2886. ############################################################################
  2887. ### Update 2.x-70 - 25/06/2002
  2888. # Bug fix: config_pgsl.inc.php must be world readable if we want IMP working
  2889. # and webmaster's scripts able to use it, because of safe mode. It's not a 
  2890. # problem since there's only one webmaster for the moment. Later, we'll have
  2891. # to use a doublon of this file.
  2892. # Obsoletes :
  2893. ############################################################################
  2894.  
  2895. if [ ! \( -e $UPDDIR/2.x-70 \) ]
  2896. then
  2897.  
  2898.   # Download the update
  2899.   cd /tmp
  2900.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-70.tgz .
  2901.  
  2902.   # Untaring
  2903.   tar zxf upd-2.x-70.tgz --directory /
  2904.   RC=$?
  2905.   /usr/local/sbin/permslis
  2906.  
  2907.   # Make a backup of config_pgsl.inc.php
  2908.   cp /home/httpd/html/config_pgsql.inc.php /home/hadmin/
  2909.  
  2910.   # Check and finish
  2911.   if [ $RC = 0 ]
  2912.   then
  2913.     touch $UPDDIR/2.x-70
  2914.     logger -t "$LOGTAG" "Update 2.x-70 Done."
  2915.   else
  2916.     logger -t "$LOGTAG" "Update 2.x-70 FAILED."
  2917.   fi
  2918. fi
  2919. ###
  2920.  
  2921. ############################################################################
  2922. ### Update 2.x-71 - 09/07/2002
  2923. # SECURITY: squid
  2924. # We use squid from RPM now, so a few more symlinks are created (I like
  2925. # spaghettis!)
  2926. # Obsoletes :
  2927. ############################################################################
  2928.  
  2929. if [ ! \( -e $UPDDIR/2.x-71 \) ]
  2930. then
  2931.  
  2932.   # Download the files
  2933.   cd /tmp
  2934.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/squid-2.4.STABLE6-6.6.2.i386.rpm .
  2935.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-71.tgz .
  2936.  
  2937.   # Do the things...
  2938.   rpm -e squid 2>/dev/null
  2939.   rpm -U squid-2.4.STABLE6-6.6.2.i386.rpm
  2940.   RC1=$?
  2941.   tar zxf upd-2.x-71.tgz --directory /
  2942.   RC2=$?  
  2943.  
  2944.   # Check and finish
  2945.   if [ $RC1 = 0 -a $RC2 = 0 ]
  2946.   then
  2947.     touch $UPDDIR/2.x-71
  2948.     /etc/rc.d/init.d/runcache stop
  2949.     killall -9 RunCache;killall -9 squid;sleep 3
  2950.     rm -f /etc/squid/squid.conf
  2951.     ln -s /usr/local/squid/etc/squid.conf /etc/squid/squid.conf
  2952.     rm -rf /var/log/squid
  2953.     ln -s /usr/local/squid/logs /var/log/squid
  2954.     mv -f /usr/local/squid/bin/squid /usr/local/squid/bin/squid.orig
  2955.     ln -s /usr/sbin/squid /usr/local/squid/bin/squid
  2956.     /etc/rc.d/init.d/runcache start
  2957.  
  2958.     logger -t "$LOGTAG" "Update 2.x-71 Done."
  2959.   else
  2960.     logger -t "$LOGTAG" "Update 2.x-71 FAILED."
  2961.   fi
  2962. fi
  2963. ###
  2964.  
  2965. ############################################################################
  2966. ### Update 2.x-72 - 09/07/2002
  2967. # Unused packages removal (preventive security)
  2968. # Obsoletes :
  2969. ############################################################################
  2970.  
  2971. if [ ! \( -e $UPDDIR/2.x-72 \) ]
  2972. then
  2973.  
  2974.   rpm -e inews
  2975.   rpm -e binutils
  2976.   rpm -e pnm2ppa
  2977.   rpm -e utempter
  2978.   rpm -e dosfstools
  2979.   rpm -e rdist
  2980.   rpm -e rsh
  2981.  
  2982.   touch $UPDDIR/2.x-72
  2983.   logger -t "$LOGTAG" "Update 2.x-72 Done."
  2984. fi
  2985. ###
  2986.  
  2987. ############################################################################
  2988. ### Update 2.x-73 - 06/09/2002
  2989. # Bug fix: Creating users may be impossible after a restore from scracth
  2990. # Obsoletes :
  2991. ############################################################################
  2992.  
  2993. if [ ! \( -e $UPDDIR/2.x-73 \) ]
  2994. then
  2995.  
  2996.   # Download the files
  2997.   cd /tmp
  2998.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-73.tgz .
  2999.  
  3000.   # Do the things...
  3001.   tar zxf upd-2.x-73.tgz --directory /
  3002.   RC=$?
  3003.   /usr/local/sbin/permslis
  3004.  
  3005.   # Check and finish
  3006.   if [ $RC = 0 ]
  3007.   then
  3008.  
  3009.     /usr/local/sbin/fix_tables
  3010.    
  3011.     touch $UPDDIR/2.x-73
  3012.     logger -t "$LOGTAG" "Update 2.x-73 Done."
  3013.   else
  3014.     logger -t "$LOGTAG" "Update 2.x-73 FAILED."
  3015.   fi
  3016. fi
  3017. ###
  3018.  
  3019. ############################################################################
  3020. ### Update 2.x-74 - 14/10/2002
  3021. # SECURITY
  3022. # Obsoletes :
  3023. ############################################################################
  3024.  
  3025. declare -i HOUR
  3026. declare -i R
  3027. HOUR=`date +%k`
  3028. R=$RANDOM
  3029. # "$R -lt 3277" in the following line means that this update
  3030. # will be executed with a probability of 1/10. This is done to
  3031. # prevent an overload of the rsync server.
  3032. # To be sure that all your SLIS are up to date, remove this part
  3033. # of the test in a couple of weeks, commenting this line and
  3034. # commenting out the next one.
  3035. #if [ ! \( -e $UPDDIR/2.x-74 \) -a $HOUR -lt 6 -a $R -lt 3277 ]
  3036. if [ ! \( -e $UPDDIR/2.x-74 \) ]
  3037. then
  3038.  
  3039.   # Clean /tmp as we need some space
  3040.   /usr/sbin/tmpwatch -f 720 /tmp/
  3041.   rm -f /tmp/kernel*
  3042.  
  3043.   # Download the files
  3044.   cd /tmp
  3045.       # obsoleted by 2.x-80
  3046.   # rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/glibc-2.1.3-27.i386.rpm . 
  3047.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/fetchmail-5.9.0-18.i386.rpm .
  3048.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/tar-1.13.25-1.6.i386.rpm .
  3049.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/unzip-5.50-1.62.i386.rpm .
  3050.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/libpng-1.0.14-0.6x.3.i386.rpm .
  3051.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/tcpdump-3.6.2-11.6.2.2.i386.rpm .
  3052.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/krb5-libs-1.1.1-29.i386.rpm .
  3053.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/krb5-configs-1.1.1-29.i386.rpm .
  3054.  
  3055.   # Do the things...
  3056.   rpm -U fetchmail-5.9.0-18.i386.rpm \
  3057.    tar-1.13.25-1.6.i386.rpm unzip-5.50-1.62.i386.rpm \
  3058.    libpng-1.0.14-0.6x.3.i386.rpm tcpdump-3.6.2-11.6.2.2.i386.rpm \
  3059.    krb5-libs-1.1.1-29.i386.rpm krb5-configs-1.1.1-29.i386.rpm
  3060.   RC=$?
  3061.  
  3062.   # Check and finish
  3063.   if [ $RC = 0 ]
  3064.   then
  3065.     touch $UPDDIR/2.x-74
  3066.     logger -t "$LOGTAG" "Update 2.x-74 Done."
  3067.   else
  3068.     logger -t "$LOGTAG" "Update 2.x-74 FAILED."
  3069.   fi
  3070. fi
  3071. ###
  3072.  
  3073. ############################################################################
  3074. ### Update 2.x-75b - 02/04/2003
  3075. # SECURITY: openssl
  3076. # Obsoletes : 2.x-75
  3077. ############################################################################
  3078.  
  3079. if [ ! \( -e $UPDDIR/2.x-75b \) ]
  3080. then
  3081.  
  3082.   # Download the files
  3083.   cd /tmp
  3084.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openssl-0.9.6b-32.62.i386.rpm .
  3085.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openssl095a-0.9.5a-20.62.i386.rpm .
  3086.  
  3087.   # Do the things...
  3088.   rpm -F --nodeps openssl-0.9.6b-32.62.i386.rpm \
  3089.                   openssl095a-0.9.5a-20.62.i386.rpm
  3090.   RC1=$?
  3091.  
  3092.   # Check and finish
  3093.   if [ $RC1 = 0 ]
  3094.   then
  3095.     ln -s /lib/libcrypto.so.0.9.6b /lib/libcrypto.so.1 2>/dev/null
  3096.     /etc/rc.d/init.d/sshd restart
  3097.     touch $UPDDIR/2.x-75b
  3098.     logger -t "$LOGTAG" "Update 2.x-75b Done."
  3099.   else
  3100.     logger -t "$LOGTAG" "Update 2.x-75b FAILED."
  3101.   fi
  3102. fi
  3103. ###
  3104.  
  3105.  
  3106. ############################################################################
  3107. ### Update 2.x-76 - 08/11/2002
  3108. # Bug fixes / Enhancements:
  3109. # - Set php max_execution_time to 10 minutes, for hadmin
  3110. # - Allow .htaccess file creation into /home/httpd/html for authconfigs
  3111. # - Added a rm of /var/lib/logrotate.status if empty into squid_rotate
  3112. # - Fixed a little bug into administrator.php (erase of hadmin http users
  3113. # that contain "admin") thanks to Rennes
  3114. # - Fixed the bug for too long urls into accesslog2sql
  3115. # Obsoletes :
  3116. ############################################################################
  3117.  
  3118. if [ ! \( -e $UPDDIR/2.x-76 \) ]
  3119. then
  3120.  
  3121.   # Increase the php max execution time for hadmin
  3122.   cp -f /etc/hadmin/php.ini /etc/hadmin/php.ini.upd-2.x-76
  3123.   perl -pi -e 's/max_execution_time.*=.*/max_execution_time = 600/' /etc/hadmin/php.ini
  3124.  
  3125.   # New httpd.conf and squid_rotate
  3126.   cp -f /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.upd-2.x-76
  3127.   cd /tmp
  3128.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-76.tgz .
  3129.   tar zxf upd-2.x-76.tgz --exclude usr/local/ --directory /
  3130.   RC=$?
  3131.   /usr/local/sbin/permslis
  3132.  
  3133.   # Check and finish
  3134.   if [ $RC = 0 ]
  3135.   then
  3136.     killall -HUP httpd
  3137.     touch $UPDDIR/2.x-76
  3138.     logger -t "$LOGTAG" "Update 2.x-76 Done."
  3139.   else
  3140.     logger -t "$LOGTAG" "Update 2.x-76 FAILED."
  3141.   fi
  3142. fi
  3143. ###
  3144.  
  3145. ############################################################################
  3146. ### Update 2.x-77 - 13/11/2002
  3147. # SECURITY: bind
  3148. # Enhancement: upgrade to bind 9: same config as for SLIS 3.0, with views
  3149. # (new mknamedconf)
  3150. # WARNING: you have to set the variable "DEFAULT_DNS" at the top of
  3151. # this update.
  3152. # CAUTION: UPDATE IS NOT DONE IF KERNEL VERSION < 2.2.19 !!
  3153. # Obsoletes :
  3154. ############################################################################
  3155.  
  3156. declare -i KREL=`uname -r |cut -f1 -d-|sed s"/\.//g"`
  3157. if [ $KREL -lt 2219 ]
  3158. then
  3159.   logger -t "$LOGTAG" "ALERT: Update 2.x-77 SKIPPED BECAUSE KERNEL IS NOT UP TO DATE!"
  3160.   logger -t "$LOGTAG" "ALERT: update kernel to 2.2.19 or newer, you have big security holes!"
  3161. else
  3162.  if [ ! \( -e $UPDDIR/2.x-77 \) ]
  3163.  then
  3164.  
  3165.   DEFAULT_DNS=193.54.149.10    # Only used if actual nameserver config
  3166.                 # could not be guessed.
  3167.  
  3168.   # Download the files
  3169.   cd /tmp
  3170.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-77.tgz .
  3171.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/bind-9.2.1-0.6x.3.i386.rpm .
  3172.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/bind-utils-9.2.1-0.6x.3.i386.rpm .
  3173.  
  3174.   # Do the things...
  3175.   tar zxf upd-2.x-77.tgz --directory /
  3176.   rpm -F bind-9.2.1-0.6x.3.i386.rpm bind-utils-9.2.1-0.6x.3.i386.rpm
  3177.   RC=$?
  3178.   /usr/local/sbin/permslis
  3179.  
  3180.   # Check and finish
  3181.   if [ $RC = 0 ]
  3182.   then
  3183.  
  3184.     # Actual DNS configuration guessing
  3185.     FORWARDERS=`grep forwarders /etc/named.conf \
  3186.                 |head -1|awk -F'[{;}]' '{print $2 " " $3}'`
  3187.     NS1=`echo $FORWARDERS|awk '{print $1'} \
  3188.          |egrep "^[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}"`
  3189.     NS2=`echo $FORWARDERS|awk '{print $2'} \
  3190.          |egrep "^[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}"`
  3191.  
  3192.     # Adding missing variables if needed
  3193.  
  3194.     # DNS_PRIMARY
  3195.     if [ "`grep DNS_PRIMARY /home/hadmin/slis.conf.pl`" = "" ]
  3196.     then
  3197.       if [ "$NS1" != "" ]
  3198.       then
  3199.         echo "DNS_PRIMARY=$NS1" >> /home/hadmin/slis.conf
  3200.         echo "\$DNS_PRIMARY=\"$NS1\";" >> /home/hadmin/slis.conf.pl
  3201.       else
  3202.         echo "DNS_PRIMARY=$DEFAULT_DNS" >> /home/hadmin/slis.conf
  3203.         echo "\$DNS_PRIMARY=\"$DEFAULT_DNS\";" >> /home/hadmin/slis.conf.pl
  3204.       fi
  3205.     fi
  3206.  
  3207.     # DNS_SECONDARY
  3208.     if [ "`grep DNS_SECONDARY /home/hadmin/slis.conf.pl`" = "" ]
  3209.     then
  3210.       if [ "$NS2" != "" ]
  3211.       then
  3212.         echo "DNS_SECONDARY=$NS2" >> /home/hadmin/slis.conf
  3213.         echo "\$DNS_SECONDARY=\"$NS2\";" >> /home/hadmin/slis.conf.pl
  3214.       else
  3215.         if [ "$NS1" != "" ]
  3216.         then
  3217.           echo "DNS_SECONDARY=$NS1" >> /home/hadmin/slis.conf
  3218.           echo "\$DNS_SECONDARY=\"$NS1\";" >> /home/hadmin/slis.conf.pl
  3219.         else
  3220.           echo "DNS_SECONDARY=$DEFAULT_DNS" >> /home/hadmin/slis.conf
  3221.           echo "\$DNS_SECONDARY=\"$DEFAULT_DNS\";" >> /home/hadmin/slis.conf.pl
  3222.         fi
  3223.       fi
  3224.     fi
  3225.  
  3226.     # GATEWAY
  3227.     if [ "`grep GATEWAY /home/hadmin/slis.conf.pl`" = "" ]
  3228.     then
  3229.       GATEWAY=`grep "ROUTEUR=" /home/hadmin/slis.conf.pl |cut -f2 -d\"`
  3230.       echo "\$GATEWAY=\"$GATEWAY\";" >> /home/hadmin/slis.conf.pl
  3231.     fi
  3232.  
  3233.     # ROUTER_TYPE
  3234.     if [ "`grep ROUTER_TYPE /home/hadmin/slis.conf.pl`" = "" ]
  3235.     then
  3236.       if [ "`ps awux |grep pppoe|grep -v grep`" != "" ]
  3237.       then
  3238.         echo "\$ROUTER_TYPE=\"9\";" >> /home/hadmin/slis.conf.pl
  3239.       fi
  3240.     fi
  3241.  
  3242.     # Zones creation
  3243.     /usr/local/sbin/mknamedzones
  3244.  
  3245.     # For a SLIS pppoe in auto mode, we need to restart the connection to force
  3246.     # a DNS reconfiguration
  3247.     if [ "`ps awux |grep pppoe|grep -v grep`" != "" -a \
  3248.          "`egrep "DNS_PRIMARY.*auto" /home/hadmin/slis.conf.pl`" != "" ]
  3249.     then
  3250.       killall pppoe 2>/dev/null
  3251.       sleep 30
  3252.     # Else, we restart normaly
  3253.     else
  3254.       cp -f /etc/named.conf /etc/named.conf.upd-2.x-77
  3255.       /usr/local/sbin/mknamedconf > /etc/named.conf
  3256.       /etc/rc.d/init.d/named restart
  3257.     fi
  3258.  
  3259.     touch $UPDDIR/2.x-77
  3260.     logger -t "$LOGTAG" "Update 2.x-77 Done."
  3261.   else
  3262.     logger -t "$LOGTAG" "Update 2.x-77 FAILED."
  3263.   fi
  3264.   sleep 60
  3265.  fi
  3266. fi
  3267. ###
  3268.  
  3269. ############################################################################
  3270. ### Update 2.x-78b - 27/11/2002
  3271. # Kernel update
  3272. # !! THIS UPDATE WILL BE DONE ONLY BY NIGHT AS IT IS A KERNEL UPDATE !!
  3273. # !! WHICH WILL REBOOT THE MACHINE                                   !!
  3274. # Obsoletes : 2.x-63, 2.x-78
  3275. ############################################################################
  3276.  
  3277. declare -i HOUR
  3278. declare -i R
  3279. HOUR=`date +%k`
  3280. R=$RANDOM
  3281. # "$R -lt 3277" in the following line means that this update
  3282. # will be executed with a probability of 1/10. This is done to
  3283. # prevent an overload of the rsync server.
  3284. # To be sure that all your SLIS are up to date, remove this part
  3285. # of the test in a couple of weeks, commenting this line and
  3286. # commenting out the next one.
  3287. #if [ ! \( -e $UPDDIR/2.x-78b \) -a $HOUR -lt 6 -a $R -lt 3277 ]
  3288. if [ ! \( -e $UPDDIR/2.x-78b \) -a $HOUR -lt 6 ]
  3289. then
  3290.  
  3291.   if [ "`/bin/uname -v|/bin/grep SMP`" = "" ]
  3292.   then
  3293.     SMP=""
  3294.     SMP2=""
  3295.   else
  3296.     SMP="-smp"
  3297.     SMP2="smp"
  3298.   fi
  3299.  
  3300.   PROC=`/bin/uname -m`
  3301.   if [ "$PROC" = "i486" ]
  3302.   then
  3303.     PROC="i386"
  3304.   fi
  3305.  
  3306.   . /home/hadmin/setup.data
  3307.   SMP3=""
  3308.   if [ "$VTUN" = "1" ]
  3309.   then
  3310.     SMP="-smp"
  3311.     SMP2="smp"
  3312.     SMP3="smp"
  3313.   fi
  3314.  
  3315.   RELEASE=`/bin/uname -r |sed s/smp//`
  3316.  
  3317.   cd /tmp
  3318.   rm -f kernel-*
  3319.   rm -f glibc-*
  3320.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/kernel`echo $SMP`-2.2.22-6.2.3.`echo $PROC`.rpm .
  3321.   RC=$?
  3322.  
  3323.   /sbin/insmod loop
  3324.   rpm --rebuilddb
  3325.   rpm -e kernel-utils 2>/dev/null
  3326.   if [ -e $UPDDIR/2.x-78 ]
  3327.   then
  3328.     rpm -U kernel`echo $SMP`-2.2.22-6.2.3.`echo $PROC`.rpm
  3329.   else
  3330.     # Keep the old kernel in case of a problem
  3331.     rpm -i kernel`echo $SMP`-2.2.22-6.2.3.`echo $PROC`.rpm
  3332.   fi
  3333.   cd /lib/modules/2.2.22-6.2.3`echo $SMP2`/net
  3334.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/tun.o.2.2.22-6.2.3 ./tun.o
  3335.  
  3336.   if [ $RC = 0 ]
  3337.   then
  3338.     /sbin/mkinitrd /boot/initrd-2.2.22-6.2.3.img 2.2.22-6.2.3 2>/dev/null
  3339.     /sbin/mkinitrd /boot/initrd-2.2.22-6.2.3smp.img 2.2.22-6.2.3smp 2>/dev/null
  3340.     sed "s/$RELEASE/2.2.22-6.2.3/g" /etc/lilo.conf > /tmp/lilo.conf
  3341.     if [ -s /tmp/lilo.conf ]
  3342.     then
  3343.       mv -f /tmp/lilo.conf /etc/lilo.conf
  3344.       /sbin/lilo; LILORC=$?
  3345.       rm -f /var/lock/slis_upd*
  3346.       touch $UPDDIR/2.x-78b
  3347.       logger -t "$LOGTAG" "Update 2.x-78b Done."
  3348.       if [ $LILORC = 0 ]
  3349.       then 
  3350.         /sbin/reboot
  3351.       else
  3352.         logger -t "$LOGTAG" "Update 2.x-78b: ERROR INTO LILO CONFIG"
  3353.         echo "$HOSTNAME problem with lilo" | mail -s "ERREUR MAJ 2.x-78b" $SLISMASTER
  3354.       fi
  3355.       killall slis_update
  3356.       killall slis_update.dev
  3357.       exit
  3358.     fi
  3359.   else
  3360.     logger -t "$LOGTAG" "Update 2.x-78b FAILED."
  3361.   fi
  3362. fi
  3363. ###
  3364.  
  3365. ############################################################################
  3366. ### Update 2.x-79 - 22/11/2002
  3367. # SECURITY: krb5 and ypserv
  3368. # Obsoletes :
  3369. ############################################################################
  3370.  
  3371. if [ ! \( -e $UPDDIR/2.x-79 \) ]
  3372. then
  3373.  
  3374.   # Download the files
  3375.   cd /tmp
  3376.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/krb5-libs-1.1.1-30.i386.rpm .
  3377.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/krb5-configs-1.1.1-30.i386.rpm .
  3378.  
  3379.   # Do the things...
  3380.   rpm -e ypserv 2>/dev/null
  3381.   rpm -F krb5-libs-1.1.1-30.i386.rpm krb5-configs-1.1.1-30.i386.rpm
  3382.   RC=$?
  3383.  
  3384.   # Check and finish
  3385.   if [ $RC = 0 ]
  3386.   then
  3387.     touch $UPDDIR/2.x-79
  3388.     logger -t "$LOGTAG" "Update 2.x-79 Done."
  3389.   else
  3390.     logger -t "$LOGTAG" "Update 2.x-79 FAILED."
  3391.   fi
  3392. fi
  3393. ###
  3394.  
  3395. ############################################################################
  3396. ### Update 2.x_3.x-02 - 21/11/2002
  3397. # Bug fix: (clientgw) changing a password with more than 8 chars caused an
  3398. # error and the user losing the password.
  3399. # Obsoletes :
  3400. ############################################################################
  3401.  
  3402. if [ ! \( -e $UPDDIR/2.x_3.x-02 \) ]
  3403. then
  3404.  
  3405.   # Download the files
  3406.   cd /tmp
  3407.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x_3.x-02.tgz .
  3408.  
  3409.   # Do the things...
  3410.   tar zxf upd-2.x_3.x-02.tgz --exclude usr/local/ --directory /
  3411.   RC=$?
  3412.   /usr/local/sbin/permslis
  3413.  
  3414.   # Check and finish
  3415.   if [ $RC = 0 ]
  3416.   then
  3417.     touch $UPDDIR/2.x_3.x-02
  3418.     logger -t "$LOGTAG" "Update 2.x_3.x-02 Done."
  3419.   else
  3420.     logger -t "$LOGTAG" "Update 2.x_3.x-02 FAILED."
  3421.   fi
  3422. fi
  3423. ###
  3424.  
  3425. ############################################################################
  3426. ### Update 2.x-80 - 28/11/2002
  3427. # SECURITY: https://rhn.redhat.com/errata/RHSA-2002-197.html
  3428. # Obsoletes : A part of 2.x-74
  3429. ############################################################################
  3430.  
  3431. declare -i HOUR
  3432. declare -i R
  3433. HOUR=`date +%k`
  3434. R=$RANDOM
  3435. # "$R -lt 3277" in the following line means that this update
  3436. # will be executed with a probability of 1/10. This is done to
  3437. # prevent an overload of the rsync server.
  3438. # To be sure that all your SLIS are up to date, remove this part
  3439. # of the test in a couple of weeks, commenting this line and
  3440. # commenting out the next one.
  3441. if [ ! \( -e $UPDDIR/2.x-80 \) -a $HOUR -lt 6 -a $R -lt 3277 ]
  3442. #if [ ! \( -e $UPDDIR/2.x-80 \) ]
  3443. then
  3444.  
  3445.   # Clean /tmp as we need some space
  3446.   /usr/sbin/tmpwatch -f 720 /tmp/
  3447.   rm -f /tmp/kernel*
  3448.  
  3449.   # Download the files
  3450.   cd /tmp
  3451.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/glibc-2.1.3-28.i386.rpm .
  3452.  
  3453.   # Do the things...
  3454.   rpm -F glibc-2.1.3-28.i386.rpm 
  3455.   RC=$?
  3456.  
  3457.   # Check and finish
  3458.   if [ $RC = 0 ]
  3459.   then
  3460.     touch $UPDDIR/2.x-80
  3461.     logger -t "$LOGTAG" "Update 2.x-80 Done."
  3462.   else
  3463.     logger -t "$LOGTAG" "Update 2.x-80 FAILED."
  3464.   fi
  3465. fi
  3466. ###
  3467.  
  3468. ############################################################################
  3469. ### Update 2.x-81 - 06/12/2002
  3470. # Bug fix: Passwd changing does not work when supplied password is >8 chars
  3471. # Obsoletes : 2.x_3.x-02: it was not good for 2.x version, only 3.x working.
  3472. ############################################################################
  3473.  
  3474. if [ ! \( -e $UPDDIR/2.x-81 \) ]
  3475. then
  3476.  
  3477.   # Download the files
  3478.   cd /tmp
  3479.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-81.tgz .
  3480.  
  3481.   # Do the things...
  3482.   tar zxf upd-2.x-81.tgz --directory /
  3483.   RC=$?
  3484.   /usr/local/sbin/permslis
  3485.  
  3486.   # Check and finish
  3487.   if [ $RC = 0 ]
  3488.   then
  3489.  
  3490.     touch $UPDDIR/2.x-81
  3491.     logger -t "$LOGTAG" "Update 2.x-81 Done."
  3492.   else
  3493.     logger -t "$LOGTAG" "Update 2.x-81 FAILED."
  3494.   fi
  3495. fi
  3496. ###
  3497.  
  3498. ############################################################################
  3499. ### Update 2.x-82 - 06/12/2002
  3500. # Security: Secure sshd configuration, thanks to Pierre Barabagelata (Nice)
  3501. # Obsoletes : 
  3502. ############################################################################
  3503. if [ ! \( -e $UPDDIR/2.x-82 \) ]
  3504. then
  3505.   perl -pi -e 's/#ChallengeResponseAuthentication yes/ChallengeResponseAuthentication no/' /etc/ssh/sshd_config
  3506.   perl -pi -e 's/#PAMAuthenticationViaKbdInt yes/PAMAuthenticationViaKbdInt no/' /etc/ssh/sshd_config 
  3507.   /etc/rc.d/init.d/sshd restart
  3508.  
  3509.   touch $UPDDIR/2.x-82
  3510.   logger -t "$LOGTAG" "Update 2.x-82 Done."
  3511. fi
  3512. ###
  3513.  
  3514. ############################################################################
  3515. ### Update 2.x-83 - 11/12/2002
  3516. # Security: https://rhn.redhat.com/errata/RHSA-2002-229.html
  3517. # Obsoletes :
  3518. ############################################################################
  3519.  
  3520. if [ ! \( -e $UPDDIR/3.x-83 -o -e $UPDDIR/2.x-83 \) ]
  3521. then
  3522.  
  3523.   # Download the files
  3524.   cd /tmp
  3525.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/wget-1.8.2-4.6x.i386.rpm .
  3526.  
  3527.   # Do the things...
  3528.   rpm -F wget-1.8.2-4.6x.i386.rpm
  3529.   RC1=$?
  3530.  
  3531.   # Check and finish
  3532.   if [ $RC1 = 0 ]
  3533.   then
  3534.     touch $UPDDIR/2.x-83
  3535.     logger -t "$LOGTAG" "Update 2.x-83 Done."
  3536.   else
  3537.     logger -t "$LOGTAG" "Update 2.x-83 FAILED."
  3538.   fi
  3539. fi
  3540. ###
  3541.  
  3542. ############################################################################
  3543. ### Update 2.x-84 - 17/12/2002
  3544. # Security: Apache update: https://rhn.redhat.com/errata/RHSA-2002-222.html
  3545. # Obsoletes :
  3546. ############################################################################
  3547.  
  3548. if [ ! \( -e $UPDDIR/2.x-84 \) ]
  3549. then
  3550.  
  3551.   # Download the files
  3552.   cd /tmp
  3553.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/apache-1.3.27-1.6.2.i386.rpm .
  3554.  
  3555.   # Do the things...
  3556.   if [ -e /home/httpd/html/index.html ]
  3557.   then
  3558.     INDEX_EXISTS=1
  3559.   else
  3560.     INDEX_EXISTS=0
  3561.   fi
  3562.   rpm -F apache-1.3.27-1.6.2.i386.rpm
  3563.   RC1=$?
  3564.  
  3565.   # Check and finish
  3566.   if [ $RC1 = 0 ]
  3567.   then
  3568.     # This is to prevent the apache test page from appearing instead of
  3569.     # an already index.php or index.htm present page:
  3570.     if [ $INDEX_EXISTS = 0 ]
  3571.     then
  3572.       mv -f /home/httpd/html/index.html /home/httpd/html/index.html.rpm 2>/dev/null
  3573.     fi
  3574.  
  3575.     /etc/rc.d/init.d/httpd stop > /dev/null
  3576.     killall httpd 2> /dev/null
  3577.     sleep 5
  3578.     killall -9 httpd 2> /dev/null
  3579.     sleep 2
  3580.     /etc/rc.d/init.d/httpd start > /dev/null
  3581.     export PHPRC="/etc/hadmin";/usr/sbin/httpd -f /etc/hadmin/conf/httpd.conf;export -n PHPRC
  3582.     export PHPRC=/etc/hadmin;/usr/sbin/httpd -f /etc/hadmin/clientgw/conf/httpd.conf;export -n PHPRC
  3583.  
  3584.     touch $UPDDIR/2.x-84
  3585.     logger -t "$LOGTAG" "Update 2.x-84 Done."
  3586.   else
  3587.     logger -t "$LOGTAG" "Update 2.x-84 FAILED."
  3588.   fi
  3589. fi
  3590. ###
  3591.  
  3592. ############################################################################
  3593. ### Update 2.x-85 - 18/12/2002
  3594. # Security: https://rhn.redhat.com/errata/RHSA-2002-293.html
  3595. # Obsoletes :
  3596. ############################################################################
  3597.  
  3598. if [ ! \( -e $UPDDIR/2.x-85 \) ]
  3599. then
  3600.  
  3601.   # Download the files
  3602.   cd /tmp
  3603.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/fetchmail-5.9.0-21.6.2.i386.rpm .
  3604.  
  3605.   # Do the things...
  3606.   rpm -F fetchmail-5.9.0-21.6.2.i386.rpm
  3607.   RC1=$?
  3608.  
  3609.   # Check and finish
  3610.   if [ $RC1 = 0 ]
  3611.   then
  3612.     touch $UPDDIR/2.x-85
  3613.     logger -t "$LOGTAG" "Update 2.x-85 Done."
  3614.   else
  3615.     logger -t "$LOGTAG" "Update 2.x-85 FAILED."
  3616.   fi
  3617. fi
  3618. ###
  3619.  
  3620. ############################################################################
  3621. ### Update 2.x-86 - 19/12/2002
  3622. # Bug fix: Safe mode restriction did not allowed inclusion of config_pgsql.inc.php
  3623. # from custom php scripts and webmail working at the same time because of
  3624. # permissions on this file.
  3625. # Obsoletes: 
  3626. ############################################################################
  3627.  
  3628. if [ ! \( -e $UPDDIR/2.x-86 \) ]
  3629. then
  3630.  
  3631.   # Download the files
  3632.   cd /tmp
  3633.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-86.tgz .
  3634.  
  3635.   # Do the things...
  3636.   tar zxf upd-2.x-86.tgz --directory /
  3637.   RC=$?
  3638.  
  3639.   cp -f /home/httpd/html/config_pgsql.inc.php /usr/share/php/
  3640.   perl -pi -e "s,\.\./\.\./config_pgsql\.inc\.php,config_pgsql.inc.php," /home/httpd/html/horde/imp/config/defaults.php3
  3641.   bash /usr/local/sbin/permslis
  3642.  
  3643.   # Check and finish
  3644.   if [ $RC = 0 ]
  3645.   then
  3646.  
  3647.     touch $UPDDIR/2.x-86
  3648.     logger -t "$LOGTAG" "Update 2.x-86 Done."
  3649.   else
  3650.     logger -t "$LOGTAG" "Update 2.x-86 FAILED."
  3651.   fi
  3652. fi
  3653. ###
  3654.  
  3655. ############################################################################
  3656. ### Update 2.x-89 - 07/02/2003
  3657. # Bug fix: logrotate not up to date, so apache log files are not rotated
  3658. # Obsoletes :
  3659. ############################################################################
  3660.  
  3661. if [ ! \( -e $UPDDIR/2.x-89 \) ]
  3662. then
  3663.  
  3664.   # Download the files
  3665.   cd /tmp
  3666.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/logrotate-3.5.2-0.6.i386.rpm .
  3667.  
  3668.   # Do the things...
  3669.   rpm -F logrotate-3.5.2-0.6.i386.rpm
  3670.   RC1=$?
  3671.  
  3672.   # Check and finish
  3673.   if [ $RC1 = 0 ]
  3674.   then
  3675.     touch $UPDDIR/2.x-89
  3676.     logger -t "$LOGTAG" "Update 2.x-89 Done."
  3677.   else
  3678.     logger -t "$LOGTAG" "Update 2.x-89 FAILED."
  3679.   fi
  3680. fi
  3681. ###
  3682.  
  3683. ############################################################################
  3684. ### Update 2.x-90 - 11/02/2003
  3685. # SECURITY:
  3686. # https://rhn.redhat.com/errata/RHSA-2003-006.html
  3687. # https://rhn.redhat.com/errata/RHSA-2002-297.html
  3688. # https://rhn.redhat.com/errata/RHSA-2003-020.html
  3689. # https://rhn.redhat.com/errata/RHSA-2003-040.html
  3690. # Obsoletes :
  3691. ############################################################################
  3692.  
  3693. if [ ! \( -e $UPDDIR/2.x-90 \) ]
  3694. then
  3695.  
  3696.   # Download the files
  3697.   cd /tmp
  3698.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/vim-common-6.1-18.6x.3.i386.rpm .
  3699.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/vim-minimal-6.1-18.6x.3.i386.rpm .
  3700.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/krb5-libs-1.1.1-32.i386.rpm .
  3701.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/krb5-configs-1.1.1-32.i386.rpm .
  3702.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openldap-1.2.13-2.i386.rpm .
  3703.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openldap-servers-1.2.13-2.i386.rpm .
  3704.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/libpng-1.0.14-0.6x.4.i386.rpm .
  3705.   
  3706.   # Do the things...
  3707.   rpm -F vim-common-6.1-18.6x.3.i386.rpm vim-minimal-6.1-18.6x.3.i386.rpm \
  3708.          krb5-libs-1.1.1-32.i386.rpm krb5-configs-1.1.1-32.i386.rpm \
  3709.          openldap-1.2.13-2.i386.rpm openldap-servers-1.2.13-2.i386.rpm \
  3710.          libpng-1.0.14-0.6x.4.i386.rpm
  3711.   RC1=$?
  3712.  
  3713.   # Check and finish
  3714.   if [ $RC1 = 0 ]
  3715.   then
  3716.     touch $UPDDIR/2.x-90
  3717.     logger -t "$LOGTAG" "Update 2.x-90 Done."
  3718.   else
  3719.     logger -t "$LOGTAG" "Update 2.x-90 FAILED."
  3720.   fi
  3721. fi
  3722. ###
  3723.  
  3724. ############################################################################
  3725. ### Update 2.x-91 - 21/02/2003
  3726. # SECURITY:
  3727. # https://rhn.redhat.com/errata/RHSA-2003-029.html
  3728. # https://rhn.redhat.com/errata/RHSA-2003-015.html
  3729. # Obsoletes :
  3730. ############################################################################
  3731.  
  3732. if [ ! \( -e $UPDDIR/2.x-91 \) ]
  3733. then
  3734.  
  3735.   # Download the files
  3736.   cd /tmp
  3737.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/lynx-2.8.3-2.1.i386.rpm .
  3738.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/fileutils-4.0-21.1.i386.rpm .
  3739.  
  3740.   # Do the things...
  3741.   rpm -F lynx-2.8.3-2.1.i386.rpm fileutils-4.0-21.1.i386.rpm
  3742.   RC1=$?
  3743.  
  3744.   # Check and finish
  3745.   if [ $RC1 = 0 ]
  3746.   then
  3747.     touch $UPDDIR/2.x-91
  3748.     logger -t "$LOGTAG" "Update 2.x-91 Done."
  3749.   else
  3750.     logger -t "$LOGTAG" "Update 2.x-91 FAILED."
  3751.   fi
  3752. fi
  3753. ###
  3754.  
  3755. ############################################################################
  3756. ### Update 2.x-92 - 19/03/2003
  3757. # SECURITY: sendmail, file
  3758. # Obsoletes :
  3759. ############################################################################
  3760.  
  3761. if [ ! \( -e $UPDDIR/2.x-92 \) ]
  3762. then
  3763.  
  3764.   # Download the files
  3765.   cd /tmp
  3766.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/sendmail-8.11.6-1.62.2.i386.rpm .
  3767.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/file-3.39-8.6x.i386.rpm .
  3768.  
  3769.   # Do the things...
  3770.   rpm -F sendmail-8.11.6-1.62.2.i386.rpm file-3.39-8.6x.i386.rpm
  3771.   RC1=$?
  3772.  
  3773.   # Check and finish
  3774.   if [ $RC1 = 0 ]
  3775.   then
  3776.     /etc/rc.d/init.d/sendmail restart
  3777.     touch $UPDDIR/2.x-92
  3778.     logger -t "$LOGTAG" "Update 2.x-92 Done."
  3779.   else
  3780.     logger -t "$LOGTAG" "Update 2.x-92 FAILED."
  3781.   fi
  3782. fi
  3783. ###
  3784.  
  3785. ############################################################################
  3786. ### Update 2.x-93 - 19/03/2003
  3787. # SECURITY: openssl
  3788. # Obsoletes :
  3789. ############################################################################
  3790.  
  3791. if [ ! \( -e $UPDDIR/2.x-93 \) ]
  3792. then
  3793.  
  3794.   # Download the files
  3795.   cd /tmp
  3796.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openssl-0.9.6b-30.62.i386.rpm .
  3797.  
  3798.   # Do the things...
  3799.   rpm -F --nodeps openssl-0.9.6b-30.62.i386.rpm
  3800.   RC1=$?
  3801.  
  3802.   # Check and finish
  3803.   if [ $RC1 = 0 ]
  3804.   then
  3805.     touch $UPDDIR/2.x-93
  3806.     logger -t "$LOGTAG" "Update 2.x-93 Done."
  3807.   else
  3808.     logger -t "$LOGTAG" "Update 2.x-93 FAILED."
  3809.   fi
  3810. fi
  3811. ###
  3812.  
  3813. ############################################################################
  3814. ### Update 2.x-80b - 20/03/2003
  3815. # SECURITY: https://rhn.redhat.com/errata/RHSA-2003-089.html
  3816. # Obsoletes : 2.x-80, a part of 2.x-74
  3817. ############################################################################
  3818.  
  3819. declare -i HOUR
  3820. declare -i R
  3821. HOUR=`date +%k`
  3822. R=$RANDOM
  3823. # "$R -lt 3277" in the following line means that this update
  3824. # will be executed with a probability of 1/10. This is done to
  3825. # prevent an overload of the rsync server.
  3826. # To be sure that all your SLIS are up to date, remove this part
  3827. # of the test in a couple of weeks, commenting this line and
  3828. # commenting out the next one.
  3829. if [ ! \( -e $UPDDIR/2.x-80b \) -a $HOUR -lt 6 -a $R -lt 3277 ]
  3830. #if [ ! \( -e $UPDDIR/2.x-80b \) ]
  3831. then
  3832.  
  3833.   # Clean /tmp as we need some space
  3834.   /usr/sbin/tmpwatch -f 720 /tmp/
  3835.   rm -f /tmp/kernel*
  3836.  
  3837.   # Download the files
  3838.   cd /tmp
  3839.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/glibc-2.1.3-29.i386.rpm .
  3840.  
  3841.   # Do the things...
  3842.   rpm -F glibc-2.1.3-29.i386.rpm
  3843.   RC=$?
  3844.  
  3845.   # Check and finish
  3846.   if [ $RC = 0 ]
  3847.   then
  3848.     touch $UPDDIR/2.x-80b
  3849.     logger -t "$LOGTAG" "Update 2.x-80b Done."
  3850.   else
  3851.     logger -t "$LOGTAG" "Update 2.x-80b FAILED."
  3852.   fi
  3853. fi
  3854. ###
  3855.  
  3856. ############################################################################
  3857. ### Update 2.x-94 - 01/04/2003
  3858. # SECURITY: sendmail, krb, samba
  3859. # Obsoletes :
  3860. ############################################################################
  3861.  
  3862. if [ ! \( -e $UPDDIR/2.x-94 \) ]
  3863. then
  3864.  
  3865.   # Download the files
  3866.   cd /tmp
  3867.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/sendmail-8.11.6-1.62.3.i386.rpm .
  3868.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/krb5-libs-1.1.1-40.i386.rpm .
  3869.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/krb5-configs-1.1.1-40.i386.rpm .
  3870.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/samba-2.0.10-1.62.i386.rpm .
  3871.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/samba-common-2.0.10-1.62.i386.rpm .
  3872.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/samba-client-2.0.10-1.62.i386.rpm .
  3873.  
  3874.   # Do the things...
  3875.   rpm -F sendmail-8.11.6-1.62.3.i386.rpm krb5-libs-1.1.1-40.i386.rpm \
  3876.          krb5-configs-1.1.1-40.i386.rpm samba-client-2.0.10-1.62.i386.rpm \
  3877.          samba-2.0.10-1.62.i386.rpm samba-common-2.0.10-1.62.i386.rpm
  3878.   RC1=$?
  3879.  
  3880.   # Check and finish
  3881.   if [ $RC1 = 0 ]
  3882.   then
  3883.     /etc/rc.d/init.d/sendmail restart
  3884.     mv -f /etc/logrotate.d/samba.rpmsave /etc/logrotate.d/samba
  3885.     touch $UPDDIR/2.x-94
  3886.     logger -t "$LOGTAG" "Update 2.x-94 Done."
  3887.   else
  3888.     logger -t "$LOGTAG" "Update 2.x-94 FAILED."
  3889.   fi
  3890. fi
  3891. ###
  3892.  
  3893. ############################################################################
  3894. ### Update 2.x-95 - 08/04/2003
  3895. # SECURITY: samba
  3896. # Obsoletes :
  3897. ############################################################################
  3898.  
  3899. #if [ ! \( -e $UPDDIR/2.x-95 \) ]
  3900. #then
  3901.  
  3902.   # Download the files
  3903. #  cd /tmp
  3904. #  rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/samba-2.2.7-3.6.2.i386.rpm .
  3905. #  rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/samba-common-2.2.7-3.6.2.i386.rpm .
  3906. #  rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/samba-client-2.2.7-3.6.2.i386.rpm .
  3907.  
  3908.   # Do the things...
  3909. #  cp /etc/smb.conf /etc/smb.conf.2.x-95
  3910. #  rpm -F --nodeps samba-common-2.2.7-3.6.2.i386.rpm samba-2.2.7-3.6.2.i386.rpm samba-client-2.2.7-3.6.2.i386.rpm
  3911. #  mv -f /etc/smb.conf.2.x-95 /etc/smb.conf
  3912. #  RC1=$?
  3913.  
  3914.   # Check and finish
  3915. #  if [ $RC1 = 0 ]
  3916. #  then
  3917. #    mv /etc/samba/smb.conf /etc/samba/smb.conf.rpm
  3918. #    ln -s /etc/smb.conf /etc/samba/smb.conf
  3919. #    mv -f /etc/logrotate.d/samba /etc/logrotate.d/samba.old
  3920. #    mv -f /etc/logrotate.d/samba.rpmnew /etc/logrotate.d/samba
  3921. #    /etc/rc.d/init.d/smb restart
  3922. #    touch $UPDDIR/2.x-95
  3923. #    logger -t "$LOGTAG" "Update 2.x-95 Done."
  3924. #  else
  3925. #    logger -t "$LOGTAG" "Update 2.x-95 FAILED."
  3926. #  fi
  3927. #fi
  3928. ###
  3929.  
  3930. ############################################################################
  3931. ### Update 2.x-96 - 11/04/2003
  3932. # SECURITY: samba does not start at boot since 2.x-95
  3933. # Obsoletes :
  3934. ############################################################################
  3935.  
  3936. if [ ! \( -e $UPDDIR/2.x-96 \) ]
  3937. then
  3938.  
  3939.   . /home/hadmin/slis.conf
  3940.   if [ "$SAMBA" = "1" -o "$CYBERECOLE" = "1" -o "CYBERSCHOOL" = 1 ]
  3941.   then
  3942.     /sbin/chkconfig --add smb
  3943.     /sbin/chkconfig smb on
  3944.   fi
  3945.  
  3946.   touch $UPDDIR/2.x-96
  3947.   logger -t "$LOGTAG" "Update 2.x-96 Done."
  3948. fi
  3949. ###
  3950.  
  3951. ############################################################################
  3952. ### Update 2.x-97 - 14/04/2003
  3953. # SECURITY: some smb.conf disapeared!
  3954. # Obsoletes :
  3955. ############################################################################
  3956.  
  3957. if [ ! \( -e $UPDDIR/2.x-97 \) ]
  3958. then
  3959.   cp -f /etc/smb.conf /etc/smb.conf.2.x-97
  3960.   mv -f /etc/samba/smb.conf /etc/samba/smb.conf.orig
  3961.   ln -s /etc/smb.conf /etc/samba/smb.conf
  3962.   /usr/local/sbin/valid
  3963.  
  3964.   touch $UPDDIR/2.x-97
  3965.   logger -t "$LOGTAG" "UPDATE 2.x-97 Done."
  3966. fi
  3967. ###
  3968.  
  3969. ############################################################################
  3970. ### Update 2.x-98 - 15/04/2003
  3971. # Bug fix: when deleting and creating again a group, the home into
  3972. # cyberschool directory had not the good perms.
  3973. # Obsoletes:
  3974. ############################################################################
  3975.  
  3976. if [ ! \( -e $UPDDIR/2.x-98 \) ]
  3977. then
  3978.  
  3979.   # Download the files
  3980.   cd /tmp
  3981.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-98.tgz .
  3982.  
  3983.   # Do the things...
  3984.   tar zxf upd-2.x-98.tgz --directory /
  3985.   RC=$?
  3986.  
  3987.   # Check and finish
  3988.   if [ $RC = 0 ]
  3989.   then
  3990.  
  3991.     /usr/local/sbin/valid
  3992.     touch $UPDDIR/2.x-98
  3993.     logger -t "$LOGTAG" "Update 2.x-98 Done."
  3994.   else
  3995.     logger -t "$LOGTAG" "Update 2.x-98 FAILED."
  3996.   fi
  3997. fi
  3998. ###
  3999.  
  4000. ############################################################################
  4001. ### Update 2.x-95c - 15/04/2003
  4002. # SECURITY: samba
  4003. # This is the RH 6.2 update SRPM patched from
  4004. #   http://fi.samba.org/samba/ftp/WHATSNEW-2.2.8a.txt
  4005. # Obsoletes : 2.x-95 (was bugged) and 2.x-95b (samba 2.2.8a was instable on
  4006. #             redhat 6.2)
  4007. ############################################################################
  4008.  
  4009. if [ ! \( -e $UPDDIR/2.x-95c \) ]
  4010. then
  4011.  
  4012.   # Download the files
  4013.   cd /tmp
  4014.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/samba-2.0.10-2.62.i386.rpm .
  4015.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/samba-common-2.0.10-2.62.i386.rpm .
  4016.  
  4017.   # Do the things...
  4018.   cp /etc/smb.conf /etc/smb.conf.2.x-95c
  4019.   rpm --oldpackage -U samba-2.0.10-2.62.i386.rpm samba-common-2.0.10-2.62.i386.rpm 
  4020.   RC1=$?
  4021.  
  4022.   # Check and finish
  4023.   if [ $RC1 = 0 ]
  4024.   then
  4025.     RUNNING=`ps awux |grep smb |grep -v grep`
  4026.     if [ "$RUNNING" != "" ]
  4027.     then
  4028.        /etc/rc.d/init.d/smb stop
  4029.        sleep 5
  4030.        /etc/rc.d/init.d/smb start
  4031.     fi
  4032.     /usr/local/sbin/valid
  4033.     touch $UPDDIR/2.x-95c
  4034.     logger -t "$LOGTAG" "Update 2.x-95c Done."
  4035.   else
  4036.     logger -t "$LOGTAG" "Update 2.x-95c FAILED."
  4037.   fi
  4038. fi
  4039. ###
  4040.  
  4041. ############################################################################
  4042. ### Update 2.x-99 - 16/04/2003
  4043. # SECURITY: postgresql
  4044. # Obsoletes : 2.x-87 (never published)
  4045. ############################################################################
  4046.  
  4047. if [ ! \( -e $UPDDIR/2.x-99 \) ]
  4048. then
  4049.  
  4050.   # Download the files
  4051.   cd /tmp
  4052.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/postgresql-server-7.0.3-9.2.62.i386.rpm .
  4053.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/postgresql-7.0.3-9.2.62.i386.rpm .
  4054.  
  4055.   # Do the things...
  4056.   /etc/rc.d/init.d/postgresql stop
  4057.   sleep 10
  4058.   rpm -F --nodeps postgresql-server-7.0.3-9.2.62.i386.rpm postgresql-7.0.3-9.2.62.i386.rpm
  4059.   RC1=$?
  4060.  
  4061.   # Check and finish
  4062.   if [ $RC1 = 0 ]
  4063.   then
  4064.     killall postmaster
  4065.     sleep 1
  4066.     killall -9 postmaster
  4067.     sleep 1
  4068.     rm -f /var/lib/pgsql/data/postmaster.pid
  4069.     /etc/rc.d/init.d/postgresql start
  4070.  
  4071.     touch $UPDDIR/2.x-99
  4072.     logger -t "$LOGTAG" "Update 2.x-99 Done."
  4073.   else
  4074.     logger -t "$LOGTAG" "Update 2.x-99 FAILED."
  4075.   fi
  4076. fi
  4077. ###
  4078.  
  4079. ############################################################################
  4080. ### Update 2.x-100 - 10/07/2003
  4081. # Smarter slis_update script. It tests the connection to the rsync
  4082. # host before starting the updates.
  4083. # Warning! This update needs TESTFILES.* to be in place, not only upd-2.x-100.tgz!
  4084. # Obsolletes :
  4085. ############################################################################
  4086.  
  4087. if [ ! \( -e $UPDDIR/2.x-100 \) ]
  4088. then
  4089.  
  4090.   # Download the files
  4091.   cd /tmp
  4092.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-100.tgz .
  4093.  
  4094.   # Do the things....
  4095.   tar zxf upd-2.x-100.tgz
  4096.   RC=$?
  4097.  
  4098.   # Check and finish
  4099.   if [ $RC = 0 ]
  4100.   then
  4101.     echo "mv -f /tmp/slis_update_3_1_slisv2.bash /usr/local/sbin/slis_update" | at now + 20 minutes
  4102.     touch $UPDDIR/2.x-100
  4103.     logger -t "$LOGTAG" "Update 2.x-100 Done."
  4104.   else
  4105.     logger -t "$LOGTAG" "Update 2.x-100 FAILED."
  4106.   fi
  4107. fi
  4108. ###
  4109.  
  4110. ############################################################################
  4111. ### Update 2.x-101 - 08/09/2003
  4112. # SECURITY: ftpd
  4113. # Obsoletes :
  4114. ############################################################################
  4115.  
  4116. if [ ! \( -e $UPDDIR/2.x-101 \) ]
  4117. then
  4118.  
  4119.   # Download the files
  4120.   cd /tmp
  4121.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/wu-ftpd-2.6.2-11.73-62.1.i386.rpm .
  4122.  
  4123.   # Do the things...
  4124.   ln -s /lib/libssl.so.0.9.6b /lib/libssl.so.1
  4125.   rpm -F --nodeps wu-ftpd-2.6.2-11.73-62.1.i386.rpm
  4126.   RC1=$?
  4127.  
  4128.   # Check and finish
  4129.   if [ $RC1 = 0 ]
  4130.   then
  4131.     /etc/init.d/inet restart
  4132.  
  4133.     touch $UPDDIR/2.x-101
  4134.     logger -t "$LOGTAG" "Update 2.x-101 Done."
  4135.   else
  4136.     logger -t "$LOGTAG" "Update 2.x-101 FAILED."
  4137.   fi
  4138. fi
  4139. ###
  4140.  
  4141. ############################################################################
  4142. ### Update 2.x-102 - 08/09/2003
  4143. # SECURITY: Disabling swat, telnet (unusefull) and auth
  4144. # Obsoletes :
  4145. ############################################################################
  4146.  
  4147. if [ ! \( -e $UPDDIR/2.x-102 \) ]
  4148. then
  4149.  
  4150.   /bin/cp -f /etc/inetd.conf /etc/inetd.conf.2.x-102
  4151.   /usr/bin/perl -pi -e "s/^swat/#swat/" /etc/inetd.conf
  4152.   /usr/bin/perl -pi -e "s/^telnet/#telnet/" /etc/inetd.conf
  4153.   /etc/rc.d/init.d/inet restart
  4154.   /etc/rc.d/init.d/identd stop
  4155.   /sbin/chkconfig identd off
  4156.  
  4157.   touch $UPDDIR/2.x-102
  4158.   logger -t "$LOGTAG" "Update 2.x-102 Done."
  4159. fi
  4160. ###
  4161.  
  4162. ############################################################################
  4163. ### Update 2.x-104 - 18/09/2003
  4164. # SECURITY: openssh
  4165. # Obsoletes : 2.x-103
  4166. ############################################################################
  4167.  
  4168. if [ ! \( -e $UPDDIR/2.x-104 \) ]
  4169. then
  4170.  
  4171.   # Download the files
  4172.   cd /tmp
  4173.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openssh-3.1p1-13slis2x.i386.rpm .
  4174.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openssh-server-3.1p1-13slis2x.i386.rpm .
  4175.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openssh-clients-3.1p1-13slis2x.i386.rpm .
  4176.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/sendmail-8.11.6-27.62.i386.rpm .
  4177.  
  4178.   # Do the things...
  4179.   rpm -F --nodeps openssh-3.1p1-13slis2x.i386.rpm \
  4180.          openssh-server-3.1p1-13slis2x.i386.rpm \
  4181.          openssh-clients-3.1p1-13slis2x.i386.rpm \
  4182.          sendmail-8.11.6-27.62.i386.rpm
  4183.   RC1=$?
  4184.  
  4185.   # Check and finish
  4186.   if [ $RC1 = 0 ]
  4187.   then
  4188.     /etc/rc.d/init.d/sshd restart
  4189.     /etc/rc.d/init.d/sendmail stop
  4190.     sleep 5
  4191.     killall -9 sendmail 2> /dev/null
  4192.     sleep 1
  4193.     /etc/rc.d/init.d/sendmail start
  4194.  
  4195.     touch $UPDDIR/2.x-104
  4196.     logger -t "$LOGTAG" "Update 2.x-104 Done."
  4197.   else
  4198.     logger -t "$LOGTAG" "Update 2.x-104 FAILED."
  4199.   fi
  4200. fi
  4201. ###
  4202.  
  4203.  
  4204. ############################################################################
  4205. ### Update 2.x-105 - 30/04/2004
  4206. # SECURITY: firewall is not started at boot since update CP-2
  4207. # Obsoletes :
  4208. ############################################################################
  4209.  
  4210. if [ ! \( -e $UPDDIR/2.x-105 \) ]
  4211. then
  4212.  
  4213.   NEEDED=`grep mkfilters /etc/rc.d/rc.local`
  4214.   if [ "$NEEDED" = "" ]
  4215.   then
  4216.     perl -pi -e "s;Activation du routage avec translation.*;Router and Firewall activation\n  /usr/local/sbin/mkfilters;" /etc/rc.d/rc.local
  4217.    /usr/local/sbin/mkfilters
  4218.   fi
  4219.  
  4220.   touch $UPDDIR/2.x-105
  4221.   logger -t "$LOGTAG" "Update 2.x-105 Done."
  4222. fi
  4223.  
  4224. ############################################################################
  4225. # Update 2.x-106 - 06/05/2004
  4226. # SECURITY: Fixes a vulnerability of the web server configuration: one could
  4227. # do a privilege escalation by using SSI and a mistake in the permission of
  4228. # the httpd.conf file. Thanx to Jean Diraison, from Versailles!
  4229. # Obsoletes :
  4230. ############################################################################
  4231.  
  4232. if [ ! \( -e $UPDDIR/2.x-106 \) ]
  4233. then
  4234.      # Download the files
  4235.      cd /tmp
  4236.      rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-106.tgz .
  4237.  
  4238.      # Do the things ...
  4239.      tar xfz upd-2.x-106.tgz --exclude usr/local/ --directory /
  4240.      RC=$?
  4241.      bash /usr/local/sbin/permslis
  4242.      perl -pi -e "s/AddHandler server-parsed/#AddHandler server-parsed/" /etc/httpd/conf/httpd.conf
  4243.      killall -HUP httpd
  4244.  
  4245.      # Check and finish
  4246.      if [ $RC = 0 ]
  4247.      then
  4248.          touch $UPDDIR/2.x-106
  4249.          logger -t "$LOGTAG" "Update 2.x-106 Done."
  4250.      else
  4251.          logger -t "$LOGTAG" "Update 2.x-106 FAILED."
  4252.      fi
  4253. fi
  4254. ###
  4255.  
  4256. ############################################################################
  4257. # Update 2.x-107 - 11/05/2004
  4258. # BUG FIX: 2.x-106 side effect: administrator could not change passwd anymore
  4259. # SECURITY: The admin could pass arbitrary commands to root by using well
  4260. # constructed urls sent to the services.php script. (Thanx to Jean Diraison)
  4261. # Obsoletes :
  4262. ############################################################################
  4263.  
  4264. if [ ! \( -e $UPDDIR/2.x-107 \) ]
  4265. then
  4266.      # Download the files
  4267.      cd /tmp
  4268.      rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-107.tgz .
  4269.  
  4270.      # Do the things ...
  4271.      tar xfz upd-2.x-107.tgz --exclude usr/local/ --directory /
  4272.      RC=$?
  4273.      bash /usr/local/sbin/permslis
  4274.  
  4275.      # Check and finish
  4276.      if [ $RC = 0 ]
  4277.      then
  4278.          touch $UPDDIR/2.x-107
  4279.          logger -t "$LOGTAG" "Update 2.x-107 Done."
  4280.      else
  4281.          logger -t "$LOGTAG" "Update 2.x-107 FAILED."
  4282.      fi
  4283. fi
  4284. ###
  4285.  
  4286. ############################################################################
  4287. # Update 2.x-108 - 23/06/2004
  4288. # Bug fix: precompiled adult database was not loaded by squidguard
  4289. # (new mksquidguardconf script)
  4290. # Obsoletes :
  4291. ############################################################################
  4292.  
  4293. if [ ! \( -e $UPDDIR/2.x-108 \) ]
  4294. then
  4295.      # Download the files
  4296.      cd /tmp
  4297.      rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-108.tgz .
  4298.  
  4299.      # Do the things ...
  4300.      tar xfz upd-2.x-108.tgz --exclude usr/local/ --directory /
  4301.      RC=$?
  4302.      bash /usr/local/sbin/permslis
  4303.      /usr/local/sbin/mksquidguardconf
  4304.      killall -HUP squid
  4305.  
  4306.      # Check and finish
  4307.      if [ $RC = 0 ]
  4308.      then
  4309.          touch $UPDDIR/2.x-108
  4310.          logger -t "$LOGTAG" "Update 2.x-108 Done."
  4311.      else
  4312.          logger -t "$LOGTAG" "Update 2.x-108 FAILED."
  4313.      fi
  4314. fi
  4315. ###
  4316.  
  4317. ############################################################################
  4318. ### Mise a jour PQ - 05/04/2000
  4319. # Nouveau script /usr/local/sbin/process_queue
  4320. # Rend obsolete : 004-0 a 004-7 et PQ-1 PQ-2 PQ-3 PQ-4 PQ-5 PQ-6 PQ-7 ...
  4321. # Si un nouveau process_queue est rΘalisΘ, juste remplacer le numero de
  4322. # version et le fichier.
  4323. # ATTENTION: Laisser cette UPD en fin de fichier, avant les UPD KERNEL.
  4324. ############################################################################
  4325. VERSION=15
  4326. DELAI=5 # Delai en minutes. C'est le temps estime que prendra l'execution de
  4327.         # la fin de ce script plus une marge (install d'un nouveau slis)...
  4328.  
  4329. if [ ! \( -e $UPDDIR/PQ-$VERSION \) ]
  4330. then
  4331.   PAS_UPD_KERNEL=1 # Empeche de faire une update du noyau
  4332.  
  4333.   # Telechargement du nouveau fichier
  4334.   cd /tmp
  4335.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/process_queue-2.x .
  4336.   mv -f process_queue-2.x process_queue
  4337.   # Si slis_update est lance par process_queue, il faut faire attention
  4338.   # a ne pas le remplacer tout de suite:
  4339.   PS=`ps auwx | grep process_queue|grep -v grep`
  4340.   if [ "$PS" != "" ]
  4341.   then 
  4342.     echo "mv -f /tmp/process_queue /usr/local/sbin/ ; chmod 700 /usr/local/sbin/process_queue" | at now + $DELAI minutes
  4343.   else
  4344.     mv -f /tmp/process_queue /usr/local/sbin/ ; chmod 700 /usr/local/sbin/process_queue
  4345.   fi
  4346.   touch $UPDDIR/PQ-$VERSION
  4347.   logger -t "$LOGTAG" "UPDATE PQ-$VERSION effectuee."
  4348. fi
  4349. ###
  4350.  
  4351.  
  4352. ############################################################################
  4353. ### Mise a jour NOTIFY - 29/04/99
  4354. # Notify
  4355. # Rend obsolete : 
  4356. ############################################################################
  4357.  
  4358. if [ ! \( -e $UPDDIR/NOTIFY \) ]
  4359. then
  4360.   echo "$HOSTNAME installe et MAJ" | mail -s "Nouveau SLIS 2.0" $SLISMASTER
  4361.   sleep 2
  4362.   /usr/lib/sendmail -q
  4363.   killall crond
  4364.   sleep 1
  4365.   crond
  4366.  
  4367.   touch $UPDDIR/NOTIFY
  4368.   logger -t "$LOGTAG" "NOTIFY envoye."
  4369. fi
  4370. ###
  4371.  
  4372. ##############################
  4373. logger -t "$LOGTAG" "Script Version 2.0 Termine."
  4374.  
  4375. /bin/rm -rf /var/lock/slis_upd
  4376.