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.1 < prev    next >
Text File  |  2004-06-22  |  82KB  |  2,883 lines

  1. #!/bin/bash
  2.  
  3. # slis_update-2.1
  4. # Updates for SLIS 2.1
  5.  
  6. ### VARIABLES ###
  7. UPDDIR=/home/hadmin/updates
  8. LOGTAG="slis_update[$$]"
  9. grep HOSTNAME /etc/sysconfig/network > /tmp/hostname
  10. . /tmp/hostname
  11. rm -rf /tmp/hostname
  12. WEBMASTER=`ls -ld /home/httpd/html |awk '{print $3}'`
  13. . /home/hadmin/slis.conf
  14.  
  15. ##################
  16.  
  17. # Locking
  18. if [ -e /var/lock/slis_upd ]
  19. then
  20.   logger -t "$LOGTAG" "Lock found. Update already started."
  21.   exit
  22. fi
  23. touch /var/lock/slis_upd
  24. sleep 1
  25.  
  26. logger -t "$LOGTAG" "Script Version 2.1 started."
  27.  
  28.  
  29. ############################################################################
  30. ### Update 2.1-1 - 13/09/2001
  31. # New script vnc_portfw
  32. # - Bug correction: the firewall was misconfigured when a port redir was done
  33. # - Enhancements for Vtun option: both the ip of the tunnel and the real
  34. # interface are configured for the redir
  35. # Obsoletes :
  36. ############################################################################
  37.  
  38. if [ ! \( -e $UPDDIR/2.1-1 \) ]
  39. then
  40.   # Telechargement du tar
  41.   cd /tmp
  42.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.1-1.tgz .
  43.   cd /
  44.   tar zxf /tmp/upd-2.1-1.tgz
  45.   RC=$?
  46.  
  47.   # Verification et fin de la MAJ
  48.   if [ $RC = 0 ]
  49.   then
  50.     touch $UPDDIR/2.1-1
  51.     logger -t "$LOGTAG" "Update 2.1-1 Done."
  52.   else
  53.     logger -t "$LOGTAG" "Update 2.1-1 FAILED."
  54.   fi
  55. fi
  56. ###
  57.  
  58. ############################################################################
  59. ### Update SQUID RESTART - 19/09/2001
  60. # Squid needs to be restarted, I don't know why for the moment
  61. # Obsoletes :
  62. ############################################################################
  63.  
  64. if [ "`/bin/ps awux |grep squid|grep -v grep`" = "" ]
  65. then
  66.     /etc/rc.d/init.d/runcache restart
  67.     logger -t "$LOGTAG" "SQUID WAS DOWN. RESTARTED."
  68. fi
  69. ###
  70.  
  71. ############################################################################
  72. ### Update 2.1-3 - 18/09/2001
  73. # Places a warning in place of the password changing gateway
  74. # Obsoletes :
  75. ############################################################################
  76.  
  77. if [ ! \( -e $UPDDIR/2.1-3 \) ]
  78. then
  79.   # Telechargement du tar
  80.   cd /tmp
  81.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.1-3.tgz .
  82.   cd /
  83.   tar zxf /tmp/upd-2.1-3.tgz
  84.   RC=$?
  85.  
  86.   # Verification et fin de la MAJ
  87.   if [ $RC = 0 ]
  88.   then
  89.     touch $UPDDIR/2.1-3
  90.     logger -t "$LOGTAG" "Update 2.1-3 Done."
  91.   else
  92.     logger -t "$LOGTAG" "Update 2.1-3 FAILED."
  93.   fi
  94. fi
  95. ###
  96.  
  97. ############################################################################
  98. ### Update 2.1-4 - 19/09/2001
  99. # Wget RPM was missing
  100. # Obsoletes :
  101. ############################################################################
  102.  
  103. if [ ! \( -e $UPDDIR/2.1-4 \) ]
  104. then
  105.   cd /tmp
  106.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/wget-1.5.3-6.i386.rpm .
  107.   rpm -U ./wget-1.5.3-6.i386.rpm
  108.   RC=$?
  109.  
  110.   # Verification et fin de la MAJ
  111.   if [ $RC = 0 ]
  112.   then
  113.     touch $UPDDIR/2.1-4
  114.     logger -t "$LOGTAG" "Update 2.1-4 Done."
  115.   else
  116.     logger -t "$LOGTAG" "Update 2.1-4 FAILED."
  117.   fi
  118. fi
  119. ###
  120.  
  121. ############################################################################
  122. ### Mise a jour 2.x-40 - 26/09/2001
  123. # Secu updates and bug corrections from RedHat:
  124. # - Secu: fetchmail is updated if fetchmail option is activated, removed else
  125. # - Bug corrected in tmpwatch package
  126. # - Secu: Sendmail local exploit bug corrected
  127. # - Secu: Man local exploit corrected (mktemp package also upgraded)
  128. # Rend obsolete :
  129. ############################################################################
  130.  
  131. if [ ! \( -e $UPDDIR/2.0-40 \) ]
  132. then
  133.  
  134.   cd /tmp
  135.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/tmpwatch-2.8-0.6.x.i386.rpm .
  136.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/sendmail-8.11.6-1.6.x.i386.rpm .
  137.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/mktemp-1.5-2.1.6x.i386.rpm .
  138.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/man-1.5i2-0.6x.5.i386.rpm .
  139.   rpm -U tmpwatch-2.8-0.6.x.i386.rpm
  140.   rpm -U sendmail-8.11.6-1.6.x.i386.rpm
  141.   rpm -U mktemp-1.5-2.1.6x.i386.rpm
  142.   rpm -U man-1.5i2-0.6x.5.i386.rpm
  143.  
  144.   RC1=0
  145.   . /home/hadmin/setup.data
  146.   if [ "FETCHMAIL" = "1" ]
  147.   then
  148.     rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/fetchmail-5.9.0-0.6.2.i386.rpm .
  149.     rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openssl-0.9.5a-7.6.x.i386.rpm .
  150.     rpm -U fetchmail-5.9.0-0.6.2.i386.rpm
  151.     rpm -U openssl-0.9.5a-7.6.x.i386.rpm
  152.     rpm -q fetchmail-5.9.0-0.6.2 2>/dev/null >/dev/null
  153.     RC1=$?
  154.   else
  155.     rpm -e fetchmail
  156.   fi
  157.  
  158.   # Verifications et fin de l'install
  159.   rpm -q tmpwatch-2.8-0.6.x 2>/dev/null >/dev/null
  160.   RC2=$?
  161.   rpm -q sendmail-8.11.6-1.6.x 2>/dev/null >/dev/null
  162.   RC3=$?
  163.   rpm -q man-1.5i2-0.6x.5 2>/dev/null >/dev/null
  164.   RC4=$?
  165.  
  166.   if [ $RC1 = 0 -a $RC2 = 0 -a $RC3 = 0 -a $RC4 = 0 ]
  167.   then
  168.     /etc/rc.d/init.d/sendmail restart
  169.     touch $UPDDIR/2.0-40
  170.     logger -t "$LOGTAG" "UPDATE 2.0-40 effectuee"
  171.   else
  172.     logger -t "$LOGTAG" "UPDATE 2.0-40 ECHEC."
  173.   fi
  174. fi
  175. ###
  176.  
  177. ############################################################################
  178. ### UPDATE 2.x-41 - 03/10/2001
  179. # - Installation of a new http interface designed for the users (called clientgw)
  180. # This interface has only got for the moment a gateway for changing passwords.
  181. # It runs on port 2000 under the same uid of hadmin. This update installs
  182. # the config files for the new httpd daemon that will be running.
  183. # Obsoletes :
  184. ############################################################################
  185.  
  186. if [ ! \( -e $UPDDIR/2.x-41 \) ]
  187. then
  188.   # Download and install
  189.   cd /tmp
  190.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-41.tgz .
  191.   cd /
  192.   tar zxf /tmp/upd-2.x-41.tgz
  193.   RC=$?
  194.  
  195.   # Check and finish
  196.   if [ $RC = 0 ]
  197.   then
  198.     ln -s /usr/lib/apache /etc/hadmin/clientgw/modules
  199.     echo "# Client gateway" >> /etc/rc.d/rc.local
  200.     echo "export PHPRC="/etc/hadmin";/usr/sbin/httpd -f /etc/hadmin/clientgw/conf/httpd.conf;export -n PHPRC" >> /etc/rc.d/rc.local
  201.     echo "/usr/local/sbin/cg-admind&" >> /etc/rc.d/rc.local
  202.     export PHPRC="/etc/hadmin";/usr/sbin/httpd -f /etc/hadmin/clientgw/conf/httpd.conf;export -n PHPRC
  203.     /usr/local/sbin/cg-admind&
  204.     /usr/local/sbin/permslis
  205.     touch $UPDDIR/2.x-41
  206.     logger -t "$LOGTAG" "Update 2.x-41 done."
  207.   else
  208.     logger -t "$LOGTAG" "Update 2.x-41 FAILED."
  209.   fi
  210. fi
  211. ###
  212.  
  213. ############################################################################
  214. ### Update 2.1-42 - 10/10/2001
  215. # Restore system
  216. # Obsoletes :
  217. ############################################################################
  218.  
  219. if [ ! \( -e $UPDDIR/2.1-42 \) ]
  220. then
  221.   # Download
  222.   cd /tmp
  223.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-42.tgz .
  224.   tar zxf upd-2.x-42.tgz --directory /
  225.   RC=$?
  226.  
  227.   # Creating tmp dir
  228.   mkdir -p /home/hadmin/tmp
  229.   chown hadmin.hadmin /home/hadmin/tmp
  230.   chmod 700 /home/hadmin/tmp
  231.  
  232.   # patching php.ini
  233.   patch /etc/hadmin/php.ini << EOF
  234. 208c208
  235. < post_max_size        =    8M        ; Maximum size of POST data that PHP will accept.
  236. ---
  237. > post_max_size        =    100M        ; Maximum size of POST data that PHP will accept.
  238. 245c245
  239. < upload_max_filesize = 2M            ; Maximum allowed size for uploaded files
  240. ---
  241. > upload_max_filesize = 100M            ; Maximum allowed size for uploaded files
  242. EOF
  243.   killall -HUP httpd
  244.  
  245.   # Check and finish
  246.   if [ $RC = 0 ]
  247.   then
  248.     touch $UPDDIR/2.1-42
  249.     logger -t "$LOGTAG" "Update 2.1-42 Done."
  250.   else
  251.     logger -t "$LOGTAG" "Update 2.1-42 FAILED."
  252.   fi
  253. fi
  254. ###
  255.  
  256. ############################################################################
  257. ### Update 2.x-43 - 09/11/2001
  258. # Synchro with CVS. Numerous bug fixes and enhancements.
  259. # THIS UPDATE IS A BIG ONE!
  260. # Obsoletes :
  261. ############################################################################
  262.  
  263. if [ ! \( -e $UPDDIR/2.x-43 \) ]
  264. then
  265.  
  266.   # Download the update
  267.   cd /tmp
  268.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-43.tgz .
  269.   
  270.   # Kill connslogd and cg-admind as they will be replaced by the update
  271.   killall connslogd 2>/dev/null
  272.   killall cg-admind 2>/dev/null
  273.   
  274.   # If this SLIS has a dns_autoconf daemon running, kill it and set a flag
  275.   DNS=`ps awux |grep dns_autoconf |grep -v grep |wc -l`
  276.   if [ $DNS = 1 ]
  277.   then
  278.     killall dns_autoconf
  279.   fi
  280.  
  281.   # Untar the core update file
  282.   tar zxf upd-2.x-43.tgz --directory /
  283.   RC=$?
  284.  
  285.   # A missing directory (not important)
  286.   # It's only a place to put some slis files like *.sql
  287.   mkdir -p /var/lib/slis
  288.  
  289.   # Reset the permissions
  290.   bash /usr/local/sbin/permslis
  291.  
  292.   # Restart the previously killed daemons
  293.   /usr/local/sbin/connslogd&
  294.   /usr/local/sbin/cg-admind&
  295.   if [ $DNS = 1 ]
  296.   then
  297.     /usr/local/sbin/dns_autoconf&
  298.   fi
  299.  
  300.   # Continue the update only if untaring was successfull
  301.   if [ $RC = 0 ]
  302.   then
  303.  
  304.     # Usefull denied_url file in squid conf was removed by error on some 2.1 versions
  305.     # This file may be used to add some URL to deny in a hurry. It mustn't be
  306.     # empty, so we add some Xs into it.
  307.     if [ ! -f /usr/local/squid/etc/denied_url ]
  308.     then 
  309.       echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" > /usr/local/squid/etc/denied_url
  310.     fi
  311.  
  312.     # Bug fix for mail header visualization function into hadmin
  313.     /usr/sbin/usermod -G mail hadmin
  314.     killall -HUP httpd 
  315.     
  316.     # Refresh squid config file (2.1 only)
  317.     if [ "`cat /etc/version_slis_num`" = "2.1" ]
  318.     then
  319.       /usr/local/sbin/mksquidconf
  320.     fi
  321.         
  322.     # Errors from accesslog2sql are not important, so we redirect 
  323.     # output to /dev/null
  324.     R=$RANDOM
  325.     crontab -l > /tmp/cron.$R
  326.     ALREADY=`grep "access.log squid >" /tmp/cron.$R`
  327.     if [ "$ALREADY" = "" ]
  328.     then 
  329.       sed "s;access.log squid;access.log squid > /dev/null 2>/dev/null;" /tmp/cron.$R > /tmp/cron.new.$R
  330.       sed "s;access_log apache;access_log apache > /dev/null 2>/dev/null;" /tmp/cron.new.$R > /tmp/cron.$R
  331.       crontab /tmp/cron.$R
  332.     fi
  333.  
  334.     if [ ! \( -e $UPDDIR/2.x-43a \) ]
  335.     then
  336.       # New subnets activation and schedule subsystem
  337.         # Init of SQL tables and conversion of old schedules
  338.       /usr/local/sbin/old_schedules_2sql 2>/dev/null >/dev/null
  339.         # Crontab modifications
  340.       R=$RANDOM
  341.       crontab -l > /tmp/cron.$R
  342.       grep -v routage_net_o /tmp/cron.$R | grep -v Horaires > /tmp/cron.new.$R
  343.       grep -v "DO NOT EDIT" /tmp/cron.new.$R | grep -v "installed on " | grep -v "Cron version" > /tmp/cron.$R
  344.       echo "# Subnets schedules" >> /tmp/cron.$R
  345.       echo "* * * * *       /usr/local/sbin/process_subnets.cron" >> /tmp/cron.$R
  346.       crontab /tmp/cron.$R
  347.         # Init scripts update
  348.       grep -v "/usr/local/sbin/process_subnets" /etc/rc.d/rc.local | \
  349.       grep -v "cp -u /home/hadmin/cgi-bin/base/subnet" > /tmp/rc.local.$R
  350.       if [ -s /tmp/rc.local.$R ]
  351.       then
  352.         cp -f /etc/rc.d/rc.local /etc/rc.d/rc.local.2.x-43
  353.         mv -f /tmp/rc.local.$R /etc/rc.d/rc.local
  354.       fi
  355.       chmod 755 /etc/rc.d/rc.local
  356.       echo "rm -f /var/lock/process_subnets*" >> /etc/rc.d/rc.local
  357.     fi
  358.  
  359.     # Refresh ip filters (new mkfilters script)
  360.     /usr/local/sbin/mkfilters
  361.  
  362.     # Create a new database for a french application (B2i)
  363.     export PGPASSWORD=`grep PGSQL_PASS /home/httpd/html/config_pgsql.inc.php|cut -d\" -f2`
  364.     export PGUSER=`grep PGSQL_USER /home/httpd/html/config_pgsql.inc.php|cut -d\" -f2`
  365.     psql -tqc "create database b2i"
  366.  
  367.     # Change the owner of "slis" database (little bug fix)
  368.     export PGPASSWORD=`grep POSTGRESPASS /home/hadmin/html/config_pgsql.inc.php|cut -d\" -f2`
  369.     export PGUSER=`grep POSTGRESUSER /home/hadmin/html/config_pgsql.inc.php|cut -d\" -f2`
  370.     psql -tqc "update pg_database set datdba = (select usesysid from pg_user where usename = 'slis') where datname = 'slis';" template1
  371.  
  372.         # Send a mail to admin
  373.     MAIL_ADMIN=`awk '{if (NR==3) print}' $BASE/params_admin.txt`
  374.     if [ "$MAIL_ADMIN" != "" ]
  375.     then
  376.     echo "
  377.   
  378. Message envoye automatiquement par votre SLIS.
  379.   
  380. Votre SLIS vient d'etre mis a jour.
  381. Le systeme de gestion d'horaires par sous-reseaux a
  382. completement change. Un script a converti vos anciens
  383. horaires dans le nouveau systeme, mais nous vous
  384. invitons a verifier que tout est en ordre dans les
  385. fonctions avancees, "acces par sous-reseaux/horaires".
  386.   
  387.  "  | mail -s "Mise a jour SLIS" $MAIL_ADMIN
  388.     fi
  389.  
  390.     touch $UPDDIR/2.x-43
  391.     logger -t "$LOGTAG" "Update 2.x-43 Done."
  392.   else
  393.     logger -t "$LOGTAG" "Update 2.x-43 FAILED."
  394.   fi
  395. fi
  396.  
  397.  
  398. ############################################################################
  399. ### Update 2.x-43b - 04/12/2001
  400. # Big bug fix!
  401. # /etc/named.acls was not correctly updated by process_subnets.cron resulting
  402. # in some SLIS refusing DNS queries.
  403. # Obsoletes :
  404. ############################################################################
  405.  
  406. if [ ! \( -e $UPDDIR/2.x-43b \) ]
  407. then
  408.  
  409.   # Download the update
  410.   cd /tmp
  411.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-43b.tgz .
  412.  
  413.   # Untaring
  414.   tar zxf upd-2.x-43b.tgz --directory /
  415.   RC=$?
  416.   /usr/local/sbin/permslis
  417.  
  418.   # Check and finish
  419.   if [ $RC = 0 ]
  420.   then
  421.     touch $UPDDIR/2.x-43b
  422.     logger -t "$LOGTAG" "Update 2.x-43b Done."
  423.   else
  424.     logger -t "$LOGTAG" "Update 2.x-43b FAILED."
  425.   fi
  426. fi
  427. ###
  428.  
  429. ############################################################################
  430. ### Update 2.1-44 - 21/12/2001
  431. # SECURITY PATCHES
  432. # Obsoletes :
  433. ############################################################################
  434.  
  435. if [ ! \( -e $UPDDIR/2.1-44 \) ]
  436. then
  437.  
  438.   # Download the files
  439.   cd /tmp
  440.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/wu-ftpd-2.6.1-0.6x.21.i386.rpm .
  441.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/diffutils-2.7-22.6x.i386.rpm .
  442. #  rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/ucd-snmp-4.2.1-4.6.x.i386.rpm .
  443. #  rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/ucd-snmp-utils-4.2.1-4.6.x.i386.rpm .
  444.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/apache-1.3.22-0.6.i386.rpm .
  445.  
  446.   # Do the things...
  447.   rpm -e samba-client 2>/dev/null
  448.   rpm -e rpm -e ghostscript rhs-printfilters ghostscript-fonts 2>/dev/null
  449.   rpm -e lpr 2>/dev/null
  450.   rpm -F diffutils-2.7-22.6x.i386.rpm
  451.   RC1=$?
  452. #  rpm -U ucd-snmp-4.2.1-4.6.x.i386.rpm ucd-snmp-utils-4.2.1-4.6.x.i386.rpm  
  453. #  RC2=$?
  454.   rpm -F wu-ftpd-2.6.1-0.6x.21.i386.rpm
  455.   RC3=$?
  456.   rpm -F apache-1.3.22-0.6.i386.rpm
  457.   RC4=$?
  458.  
  459.   # Check and finish
  460.   if [ $RC1 = 0 -a $RC3 = 0 -a $RC4 = 0 ]
  461.   then
  462.  
  463.     # Httpd restarting
  464.     /etc/rc.d/init.d/httpd stop
  465.     killall httpd
  466.     sleep 5
  467.     /etc/rc.d/init.d/httpd start
  468.     export PHPRC="/etc/hadmin";/usr/sbin/httpd -f /etc/hadmin/conf/httpd.conf;export -n PHPRC
  469.     export PHPRC=/etc/hadmin;/usr/sbin/httpd -f /etc/hadmin/clientgw/conf/httpd.conf;export -n PHPRC
  470.  
  471.     touch $UPDDIR/2.1-44
  472.     logger -t "$LOGTAG" "Update 2.1-44 Done."
  473.   else
  474.     logger -t "$LOGTAG" "Update 2.1-44 FAILED."
  475.   fi
  476. fi
  477. ###
  478.  
  479. ############################################################################
  480. ### Update 2.x-45 - 21/12/2001
  481. # OpenSSH installation
  482. # Obsoletes :
  483. ############################################################################
  484.  
  485. if [ ! \( -e $UPDDIR/2.x-45 \) ]
  486. then
  487.  
  488.   # Download the files
  489.   cd /tmp
  490.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openssh-3.0.2p1-1.i386.rpm .
  491.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openssh-server-3.0.2p1-1.i386.rpm .
  492.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openssh-clients-3.0.2p1-1.i386.rpm .
  493.  
  494.   # Do the things...
  495.   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
  496.   rpm -q openssh-server >/dev/null
  497.   RC1=$?
  498.  
  499.   # Check and finish
  500.   if [ $RC1 = 0 ]
  501.   then
  502.  
  503.     /sbin/chkconfig --add sshd
  504.     /sbin/chkconfig sshd on
  505.     killall sshd 2>/dev/null
  506.     killall ssfd 2>/dev/null
  507.     sleep 3
  508.     killall -9 sshd 2>/dev/null
  509.     killall -9 ssfd 2>/dev/null
  510.     
  511.     /etc/rc.d/init.d/sshd start
  512.     sleep 3
  513.     /etc/rc.d/init.d/sshd restart # I dont know why, but sshd doesn't start the first time
  514.  
  515.     grep -v ssfd /etc/rc.d/rc.local |grep -v sshd > /tmp/rc.local
  516.     cp -f /etc/rc.d/rc.local /etc/rc.d/rc.local.upd-2.x-45
  517.     mv -f /tmp/rc.local /etc/rc.d/rc.local
  518.     chmod 755 /etc/rc.d/rc.local
  519.  
  520.     touch $UPDDIR/2.x-45
  521.     logger -t "$LOGTAG" "Update 2.x-45 Done."
  522.   else
  523.     logger -t "$LOGTAG" "Update 2.x-45 FAILED."
  524.   fi
  525. fi
  526. ###
  527.  
  528. ############################################################################
  529. ### Update 2.x-46 - 20/12/2001
  530. # Enhancements of the php interface
  531. # Obsoletes :
  532. ############################################################################
  533.  
  534. if [ ! \( -e $UPDDIR/2.x-46 \) ]
  535. then
  536.  
  537.   # Download the update
  538.   cd /tmp
  539.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-46.tgz .
  540.  
  541.   # Untaring
  542.   tar zxf upd-2.x-46.tgz --directory /
  543.   RC=$?
  544.   /usr/local/sbin/permslis
  545.  
  546.   # Check and finish
  547.   if [ $RC = 0 ]
  548.   then
  549.     touch $UPDDIR/2.x-46
  550.     logger -t "$LOGTAG" "Update 2.x-46 Done."
  551.   else
  552.     logger -t "$LOGTAG" "Update 2.x-46 FAILED."
  553.   fi
  554. fi
  555. ###
  556.  
  557. ############################################################################
  558. ### Update 2.x-48 - 22/01/2002
  559. # Bug fixes and enhancements:
  560. #  - bug fix: the sunday, all subnets were deactivated by process_subnets.cron
  561. #  - interface bugs with some browsers when deleting users
  562. #  - interface bug accepting some special characters in logins
  563. #  - permslis bug changing the owner of some files for the webmaster
  564. #  - optimization of the process_subnets.cron script (no more kil -HUP named
  565. #    every minute)
  566. # Security:
  567. #    removed pine, wich contains a security hole
  568. # Obsoletes : 2.x-47
  569. ############################################################################
  570.  
  571. if [ ! \( -e $UPDDIR/2.x-48 \) ]
  572. then
  573.  
  574.   # Download the update
  575.   cd /tmp
  576.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-48.tgz .
  577.  
  578.   # Untaring
  579.   tar zxf upd-2.x-48.tgz --directory /
  580.   RC=$?
  581.   /usr/local/sbin/permslis
  582.  
  583.   # Remove pine
  584.   rpm -e pine
  585.  
  586.   # Check and finish
  587.   if [ $RC = 0 ]
  588.   then
  589.     touch $UPDDIR/2.x-48
  590.     logger -t "$LOGTAG" "Update 2.x-48 Done."
  591.   else
  592.     logger -t "$LOGTAG" "Update 2.x-48 FAILED."
  593.   fi
  594. fi
  595. ###
  596.  
  597. ############################################################################
  598. ### Update 2.x-49 - 20/12/2001
  599. # Bug fixes for 2.x-48
  600. # Obsoletes :
  601. ############################################################################
  602.  
  603. if [ ! \( -e $UPDDIR/2.x-49 \) ]
  604. then
  605.  
  606.   # Download the update
  607.   cd /tmp
  608.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-49.tgz .
  609.  
  610.   # Untaring
  611.   tar zxf upd-2.x-49.tgz --directory /
  612.   RC=$?
  613.   /usr/local/sbin/permslis
  614.  
  615.   # Check and finish
  616.   if [ $RC = 0 ]
  617.   then
  618.     touch $UPDDIR/2.x-49
  619.     logger -t "$LOGTAG" "Update 2.x-49 Done."
  620.   else
  621.     logger -t "$LOGTAG" "Update 2.x-49 FAILED."
  622.   fi
  623. fi
  624. ###
  625.  
  626. ############################################################################
  627. ### Update 2.x-50 - 23/01/2002
  628. # Bug fix: IMP not working because of bad permission on config_pgsl.inc.php
  629. # Obsoletes :
  630. ############################################################################
  631.  
  632. if [ ! \( -e $UPDDIR/2.x-50 \) ]
  633. then
  634.  
  635.   # Download the update
  636.   cd /tmp
  637.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-50.tgz .
  638.  
  639.   # Untaring
  640.   tar zxf upd-2.x-50.tgz --directory /
  641.   RC=$?
  642.   /usr/local/sbin/permslis
  643.  
  644.   # Check and finish
  645.   if [ $RC = 0 ]
  646.   then
  647.     touch $UPDDIR/2.x-50
  648.     logger -t "$LOGTAG" "Update 2.x-50 Done."
  649.   else
  650.     logger -t "$LOGTAG" "Update 2.x-50 FAILED."
  651.   fi
  652. fi
  653. ###
  654.  
  655. ############################################################################
  656. ### Update 2.x-51 - 28/01/2002
  657. # SECURITY PATCHES
  658. # Obsoletes :
  659. ############################################################################
  660.  
  661. if [ ! \( -e $UPDDIR/2.x-51 \) ]
  662. then
  663.  
  664.   # Download the files
  665.   cd /tmp
  666. #  rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/at-3.1.8-22.1.i386.rpm .
  667.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/rsync-2.4.6-1.6.i386.rpm .
  668.  
  669.   # Do the things...
  670. #  rpm -U at-3.1.8-22.1.i386.rpm
  671. #  RC1=$?
  672.   rpm -U rsync-2.4.6-1.6.i386.rpm
  673.   RC2=$?
  674.  
  675.   # Check and finish
  676.   if [ $RC2 = 0 ]
  677.   then
  678.  
  679.     touch $UPDDIR/2.x-51
  680.     logger -t "$LOGTAG" "Update 2.x-51 Done."
  681.   else
  682.     logger -t "$LOGTAG" "Update 2.x-51 FAILED."
  683.   fi
  684. fi
  685. ###
  686.  
  687.  
  688. ############################################################################
  689. ### Update 2.x-52 - 05/02/2002
  690. # New function: Restore of a 2.x backup
  691. # Obsoletes :
  692. ############################################################################
  693.  
  694. if [ ! \( -e $UPDDIR/2.x-52 \) ]
  695. then
  696.  
  697.   # Download the files
  698.   cd /tmp
  699.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-52.tgz .
  700.  
  701.   # Do the things...
  702.   tar zxf upd-2.x-52.tgz --directory /
  703.   RC=$?
  704.   /usr/local/sbin/permslis
  705.  
  706.   # Check and finish
  707.   if [ $RC = 0 ]
  708.   then
  709.  
  710.     touch $UPDDIR/2.x-52
  711.     logger -t "$LOGTAG" "Update 2.x-52 Done."
  712.   else
  713.     logger -t "$LOGTAG" "Update 2.x-52 FAILED."
  714.   fi
  715. fi
  716. ###
  717.  
  718. ############################################################################
  719. ### Update 2.x-53b - 21/03/2002
  720. # New logrotate script for samba, fixing the too many logfiles bug
  721. #  2.x-53 was deleting /var/log/samba/log.smb.1.*
  722. #  2.x-53b deletes /var/log/samba/log.smb.*.*
  723. # Obsoletes : 2.x-53
  724. ############################################################################
  725.  
  726. if [ ! \( -e $UPDDIR/2.x-53b \) ]
  727. then
  728.   /usr/sbin/logrotate /etc/logrotate.conf
  729.   echo "
  730. /var/log/samba/log.nmb {
  731.     notifempty
  732.     missingok
  733.     postrotate
  734.         /usr/bin/killall -HUP nmbd
  735.     endscript
  736. }
  737. /var/log/samba/log.smb {
  738.     notifempty
  739.     missingok
  740.     postrotate
  741.         /usr/bin/killall -HUP smbd
  742.     endscript
  743. }
  744. " > /etc/logrotate.d/samba
  745.   rm -rf /var/log/samba/log.smb.*.*
  746.   rm -rf /var/log/samba/log.nmb.*.*
  747.  
  748.   grep -v samba /var/lib/logrotate.status  > /tmp/logrotate.status
  749.   mv -f /tmp/logrotate.status /var/lib/logrotate.status
  750.   /usr/sbin/logrotate /etc/logrotate.conf
  751.  
  752.   touch $UPDDIR/2.x-53b
  753.   logger -t "$LOGTAG" "Update 2.x-53b Done."
  754. fi
  755. ###
  756.  
  757. ############################################################################
  758. ### Update 2.x-54 - 28/02/2002
  759. # Enhancement: added icmp type time-excedeed allowed through the firewall (mkfilters)
  760. # Bug fix: the home of the webmaster was deleted if the user was deleted (valid)
  761. # Obsoletes :
  762. ############################################################################
  763.  
  764. if [ ! \( -e $UPDDIR/2.x-54 \) ]
  765. then
  766.  
  767.   # Download the files
  768.   cd /tmp
  769.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-54.tgz .
  770.  
  771.   # Do the things...
  772.   tar zxf upd-2.x-54.tgz --directory /
  773.   RC=$?
  774.   /usr/local/sbin/permslis
  775.  
  776.   # Check and finish
  777.   if [ $RC = 0 ]
  778.   then
  779.  
  780.     touch $UPDDIR/2.x-54
  781.     logger -t "$LOGTAG" "Update 2.x-54 Done."
  782.   else
  783.     logger -t "$LOGTAG" "Update 2.x-54 FAILED."
  784.   fi
  785. fi
  786. ###
  787.  
  788. ############################################################################
  789. ### Update 2.x-55 - 08/03/2002
  790. # SECURITY FIX: php uploads bug
  791. # ENHANCEMENT: added client support for mysql and ldap in the php module
  792. # Obsoletes :
  793. ############################################################################
  794.  
  795. if [ ! \( -e $UPDDIR/2.x-55 \) ]
  796. then
  797.  
  798.   # Download the files
  799.   cd /tmp
  800.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/php-4.0.6-1slis2x.i386.rpm .
  801.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/php-imap-4.0.6-1slis2x.i386.rpm .
  802.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/php-ldap-4.0.6-1slis2x.i386.rpm .
  803.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/php-pgsql-4.0.6-1slis2x.i386.rpm .
  804.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/mysql-3.20.32a-3.i386.rpm .
  805.  
  806.   # Do the things...
  807.   killall httpd
  808.   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
  809.   RC1=$?
  810.   /etc/rc.d/init.d/httpd start
  811.   export PHPRC="/etc/hadmin";/usr/sbin/httpd -f /etc/hadmin/conf/httpd.conf;export -n PHPRC
  812.   export PHPRC=/etc/hadmin;/usr/sbin/httpd -f /etc/hadmin/clientgw/conf/httpd.conf;export -n PHPRC
  813.   /sbin/chkconfig mysql off
  814.  
  815.   # Check and finish
  816.   if [ $RC1 = 0 ]
  817.   then
  818.  
  819.     touch $UPDDIR/2.x-55
  820.     logger -t "$LOGTAG" "Update 2.x-55 Done."
  821.   else
  822.     logger -t "$LOGTAG" "Update 2.x-55 FAILED."
  823.   fi
  824. fi
  825. ###
  826.  
  827. ############################################################################
  828. ### Update 2.1-56 - 08/03/2002
  829. # New /etc/rc.d/init.d/runcache with a test if /www-cache is 100% full,then
  830. # the cache is deleted and reconstructed.
  831. # Obsoletes :
  832. ############################################################################
  833.  
  834. if [ ! \( -e $UPDDIR/2.1-56 \) ]
  835. then
  836.  
  837.   # Download the files
  838.   cd /tmp
  839.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.1-56.tgz .
  840.  
  841.   # Do the things...
  842.   tar zxf upd-2.1-56.tgz --directory /
  843.   RC=$?
  844.   /usr/local/sbin/permslis
  845.  
  846.   # Check and finish
  847.   if [ $RC = 0 ]
  848.   then
  849.  
  850.     touch $UPDDIR/2.1-56
  851.     logger -t "$LOGTAG" "Update 2.1-56 Done."
  852.   else
  853.     logger -t "$LOGTAG" "Update 2.1-56 FAILED."
  854.   fi
  855. fi
  856. ###
  857.  
  858. ############################################################################
  859. ### Update 2.x-57 - 08/03/2002
  860. # Deletion of /var/lock/process_subnets.cron at boot
  861. # Obsoletes :
  862. ############################################################################
  863.  
  864. if [ ! \( -e $UPDDIR/2.x-57 \) ]
  865. then
  866.     echo "rm -f /var/lock/process_subnets.cron" > /etc/rc.d/rc3.d/S39Lock_cleaning
  867.     chmod 755 /etc/rc.d/rc3.d/S39Lock_cleaning
  868.  
  869.     touch $UPDDIR/2.x-57
  870.     logger -t "$LOGTAG" "Update 2.x-57 Done."
  871. fi
  872. ###
  873.  
  874. ############################################################################
  875. ### Update 2.1-58 - 12/03/2002
  876. # Bug fix: preg_grep syntax has changed since php 4.0.4
  877. # Secu: Added a blocking filter to prevent users from login into ADSL alcatel modems by telnet
  878. # Obsoletes :
  879. ############################################################################
  880.  
  881. if [ ! \( -e $UPDDIR/2.x-58 \) ]
  882. then
  883.  
  884.   # Download the files
  885.   cd /tmp
  886.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-58.tgz .
  887.  
  888.   # Do the things...
  889.   tar zxf upd-2.x-58.tgz --directory /
  890.   RC=$?
  891.   /usr/local/sbin/permslis
  892.   /usr/local/sbin/mkfilters
  893.  
  894.   # Check and finish
  895.   if [ $RC = 0 ]
  896.   then
  897.  
  898.     touch $UPDDIR/2.x-58
  899.     logger -t "$LOGTAG" "Update 2.x-58 Done."
  900.   else
  901.     logger -t "$LOGTAG" "Update 2.x-58 FAILED."
  902.   fi
  903. fi
  904. ###
  905.  
  906. ############################################################################
  907. ### Update 2.x-59 - 17/03/2002
  908. # SECURITY FIX: openssh (http://www.openbsd.org/advisories/ssh_channelalloc.txt)
  909. # Obsoletes :
  910. ############################################################################
  911.  
  912. if [ ! \( -e $UPDDIR/2.x-59 \) ]
  913. then
  914.  
  915.   # Download the files
  916.   cd /tmp
  917.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openssl095a-0.9.5a-9.i386.rpm .
  918.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openssl-0.9.6-9.i386.rpm .
  919.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openssh-3.1p1-1.i386.rpm .
  920.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openssh-clients-3.1p1-1.i386.rpm .
  921.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openssh-server-3.1p1-1.i386.rpm .
  922.  
  923.   # Do the things...
  924.   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
  925.   RC1=$?
  926.   /sbin/chkconfig sshd on
  927.  
  928.   # Check and finish
  929.   if [ $RC1 = 0 ]
  930.   then
  931.  
  932.     touch $UPDDIR/2.x-59
  933.     logger -t "$LOGTAG" "Update 2.x-59 Done."
  934.   else
  935.     logger -t "$LOGTAG" "Update 2.x-59 FAILED."
  936.   fi
  937. fi
  938. ###
  939.  
  940. ############################################################################
  941. ### Update 2.x-60 - 17/03/2002
  942. # SECURITY UPDATES FROM REDHAT:
  943. # atd, telnet and ucd-snmp
  944. # http://www.redhat.com/support/errata/RHSA-2002-015.html
  945. # http://www.redhat.com/support/errata/RHSA-2001-099.html
  946. # http://www.redhat.com/support/errata/RHSA-2001-163.html
  947. # Obsoletes : Some parts of 2.1-44 and 2.x-51
  948. ############################################################################
  949.  
  950. if [ ! \( -e $UPDDIR/2.x-60 \) ]
  951. then
  952.  
  953.   # Download the files
  954.   cd /tmp
  955.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/at-3.1.8-22.2.i386.rpm .
  956.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/telnet-0.17.6x-18.i386.rpm .
  957.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/ucd-snmp-4.2.3-1.6.x.3.i386.rpm .
  958.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/ucd-snmp-utils-4.2.3-1.6.x.3.i386.rpm .
  959.  
  960.   # Do the things...
  961.     # telnetd is dangerous and no more usefull now (ssh)
  962.   rpm -e telnet-server 
  963.     # The updates
  964.   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
  965.   RC1=$?
  966.  
  967.   # Check and finish
  968.   if [ $RC1 = 0 ]
  969.   then
  970.  
  971.     touch $UPDDIR/2.x-60
  972.     logger -t "$LOGTAG" "Update 2.x-60 Done."
  973.   else
  974.     logger -t "$LOGTAG" "Update 2.x-60 FAILED."
  975.   fi
  976. fi
  977. ###
  978.  
  979. ############################################################################
  980. ### Update 2.x-61 - 25/03/2002
  981. # Squid update (SECURITY)
  982. # Obsoletes :
  983. ############################################################################
  984.  
  985. if [ ! \( -e $UPDDIR/2.x-61 \) ]
  986. then
  987.  
  988.   # Download the files
  989.   cd /tmp
  990.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-61.tgz .
  991.  
  992.   # Do the things...
  993.   /etc/rc.d/init.d/runcache stop
  994.   sleep 60
  995.   killall -9 squid 2>/dev/null
  996.   killall -9 squidGuard 2>/dev/null
  997.   tar zxf upd-2.x-61.tgz --directory /
  998.   RC=$?
  999.   /usr/local/sbin/permslis
  1000.   /etc/rc.d/init.d/runcache start
  1001.  
  1002.   # Check and finish
  1003.   if [ $RC = 0 ]
  1004.   then
  1005.  
  1006.     touch $UPDDIR/2.x-61
  1007.     logger -t "$LOGTAG" "Update 2.x-61 Done."
  1008.   else
  1009.     logger -t "$LOGTAG" "Update 2.x-61 FAILED."
  1010.   fi
  1011. fi
  1012. ###
  1013.  
  1014. ############################################################################
  1015. ### Update 2.x-62 - 25/03/2002
  1016. # SECURITY UPDATE FROM REDHAT:
  1017. # http://www.redhat.com/support/errata/RHSA-2002-026.html
  1018. # Obsoletes :
  1019. ############################################################################
  1020.  
  1021. if [ ! \( -e $UPDDIR/2.x-62 \) ]
  1022. then
  1023.   
  1024.   # Download the files
  1025.   cd /tmp
  1026.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/zlib-1.1.3-25.6.i386.rpm .
  1027.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/rsync-2.4.6-3.6.i386.rpm .
  1028.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/rmt-0.4b19-5.6x.1.i386.rpm .
  1029.  
  1030.   # Do the things...
  1031.   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
  1032.   RC=$?
  1033.  
  1034.   # Check and finish
  1035.   if [ $RC = 0 ]
  1036.   then
  1037.     touch $UPDDIR/2.x-62
  1038.     logger -t "$LOGTAG" "Update 2.x-62 Done."
  1039.   else
  1040.     logger -t "$LOGTAG" "Update 2.x-62 FAILED."
  1041.   fi
  1042. fi
  1043. ###
  1044.  
  1045. ############################################################################
  1046. ### Update 2.x-63 - 25/03/2002
  1047. # Kernel update
  1048. # !! THIS UPDATE WILL BE DONE ONLY BY NIGHT AS IT IS A KERNEL UPDATE !!
  1049. # !! WHICH WILL REBOOT THE MACHINE                                   !!
  1050. # Obsoletes :
  1051. ############################################################################
  1052.  
  1053. declare -i HOUR
  1054. declare -i R
  1055. HOUR=`date +%k`
  1056. R=$RANDOM
  1057. # "$R -lt 3277" in the following line means that this update
  1058. # will be executed with a probability of 1/10. This is done to
  1059. # prevent an overload of the rsync server.
  1060. # To be sure that all your SLIS are up to date, remove this part
  1061. # of the test in a couple of weeks, commenting this line and
  1062. # commenting out the next one.
  1063. #if [ ! \( -e $UPDDIR/2.x-63 \) -a $HOUR -lt 6 -a $R -lt 10000 ]
  1064. if [ ! \( -e $UPDDIR/2.x-63 \) -a $HOUR -lt 6 ]
  1065. then
  1066.  
  1067.   if [ "`/bin/uname -v|/bin/grep SMP`" = "" ]
  1068.   then
  1069.     SMP=""
  1070.     SMP2=""
  1071.   else
  1072.     SMP="-smp"
  1073.     SMP2="smp"
  1074.   fi
  1075.  
  1076.   PROC=`/bin/uname -m`
  1077.   if [ "$PROC" = "i486" ]
  1078.   then
  1079.     PROC="i386"
  1080.   fi
  1081.  
  1082.   . /home/hadmin/setup.data
  1083.   SMP3=""
  1084.   if [ "$VTUN" = "1" ]
  1085.   then
  1086.     SMP="-smp"
  1087.     SMP2="smp"
  1088.     SMP3="smp"
  1089.   fi
  1090.  
  1091.   RELEASE=`/bin/uname -r |sed s/smp//`
  1092.  
  1093.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/kernel`echo $SMP`-2.2.19-6.2.16.`echo $PROC`.rpm .
  1094.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/mount-2.10r-0.6.x.i386.rpm .
  1095.  
  1096.   /sbin/insmod loop
  1097.   rpm -e kernel-utils 2>/dev/null
  1098.   rpm -F mount-2.10r-0.6.x.i386.rpm
  1099.   rpm -i kernel`echo $SMP`-2.2.19-6.2.16.`echo $PROC`.rpm
  1100.   cd /lib/modules/2.2.19-6.2.16`echo $SMP2`/net
  1101.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/tun.o .
  1102.   RC=$?
  1103.  
  1104.   if [ $RC = 0 ]
  1105.   then
  1106.     /sbin/mkinitrd /boot/initrd-2.2.19-6.2.16.img 2.2.19-6.2.16 2>/dev/null
  1107.     /sbin/mkinitrd /boot/initrd-2.2.19-6.2.16smp.img 2.2.19-6.2.16smp 2>/dev/null
  1108.     sed "s/$RELEASE/2.2.19-6.2.16$SMP3/g" /etc/lilo.conf > /tmp/lilo.conf
  1109.     if [ -s /tmp/lilo.conf ]
  1110.     then
  1111.       mv -f /tmp/lilo.conf /etc/lilo.conf
  1112.       /sbin/lilo
  1113.       rm -f /var/lock/slis_upd*
  1114.       touch $UPDDIR/2.x-63
  1115.       logger -t "$LOGTAG" "Update 2.x-63 Done."
  1116.       /sbin/reboot
  1117.       killall slis_update
  1118.       killall slis_update.dev
  1119.       exit
  1120.     fi
  1121.   else
  1122.     logger -t "$LOGTAG" "Update 2.x-63 FAILED."
  1123.   fi
  1124. fi
  1125. ###
  1126.  
  1127.  
  1128. ############################################################################
  1129. ### Update 2.x-64 - 26/03/2002
  1130. # SECURITY: Horde IMP
  1131. # Obsoletes :
  1132. ############################################################################
  1133.  
  1134. if [ ! \( -e $UPDDIR/2.x-64 \) ]
  1135. then
  1136.  
  1137.   # Download the files
  1138.   cd /tmp
  1139.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-64.tgz .
  1140.  
  1141.   # Do the things...
  1142.   tar zxf upd-2.x-64.tgz --directory /
  1143.   RC=$?
  1144.   /usr/local/sbin/permslis
  1145.  
  1146.   # Check and finish
  1147.   if [ $RC = 0 ]
  1148.   then
  1149.  
  1150.     touch $UPDDIR/2.x-64
  1151.     logger -t "$LOGTAG" "Update 2.x-64 Done."
  1152.   else
  1153.     logger -t "$LOGTAG" "Update 2.x-64 FAILED."
  1154.   fi
  1155. fi
  1156. ###
  1157.  
  1158. ############################################################################
  1159. ### Update 2.x-65 - 27/03/2002
  1160. # Bug fix: process_subnets.cron was not testing the connection to the 
  1161. # pgsql server.
  1162. # Obsoletes :
  1163. ############################################################################
  1164.  
  1165. if [ ! \( -e $UPDDIR/2.x-65 \) ]
  1166. then
  1167.  
  1168.   # Download the files
  1169.   cd /tmp
  1170.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-65.tgz .
  1171.  
  1172.   # Do the things...
  1173.   tar zxf upd-2.x-65.tgz --directory /
  1174.   RC=$?
  1175.   /usr/local/sbin/permslis
  1176.  
  1177.   # Check and finish
  1178.   if [ $RC = 0 ]
  1179.   then
  1180.  
  1181.     touch $UPDDIR/2.x-65
  1182.     logger -t "$LOGTAG" "Update 2.x-65 Done."
  1183.   else
  1184.     logger -t "$LOGTAG" "Update 2.x-65 FAILED."
  1185.   fi
  1186. fi
  1187. ###
  1188.  
  1189. ############################################################################
  1190. ### Update 2.x-66 - 03/04/2002
  1191. # Performance optimization: changed squid logs rotation script, replaced
  1192. # prostat by webalizer, optimized accesslog2sql script, reprogrammed
  1193. # crontab.
  1194. # Obsoletes :
  1195. ############################################################################
  1196.  
  1197. if [ ! \( -e $UPDDIR/2.x-66 \) ]
  1198. then
  1199.  
  1200.   # Download the files
  1201.   cd /tmp
  1202.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-66.tgz .
  1203.  
  1204.   # Do the things...
  1205.   tar zxf upd-2.x-66.tgz --directory /
  1206.   RC=$?
  1207.   /usr/local/sbin/permslis
  1208.  
  1209.   # Check and finish
  1210.   if [ $RC = 0 ]
  1211.   then
  1212.  
  1213.     # Crontab edition
  1214.     R=$RANDOM
  1215.     crontab -l |grep -v "access.log squid" | \
  1216.                 grep -v "access_log apache" | \
  1217.                 grep -v "DO NOT EDIT THIS FILE" | \
  1218.                 grep -v "installed on" | \
  1219.                 grep -v "squid_purge" | \
  1220.                 sed "s/Purge squid//" | \
  1221.                 grep -v "Squid rotation/stats calculations" | \
  1222.                 grep -v "Cron version --" > /tmp/cron.$R
  1223.     echo >> /tmp/cron.$R
  1224.     echo "# Access logs rotation, sql storing and stats calculation" >> /tmp/cron.$R
  1225.     echo "30 23 * * *     /usr/local/sbin/squid_rotate > /dev/null 2>/dev/null" >> /tmp/cron.$R
  1226.     echo "30 0 * * *       export LANG=C;/usr/local/sbin/accesslog2sql /var/log/httpd/access_log apache > /dev/null 2>/dev/null" >> /tmp/cron.$R
  1227.     crontab -l > /home/hadmin/updates/cron.2.x-66.bak
  1228.     crontab /tmp/cron.$R    
  1229.  
  1230.     # Webalizer installation
  1231.     mkdir /home/hadmin/html/cache_usage
  1232.     if [ "$LANGUAGE" = "french" ]
  1233.     then
  1234.       ln -s /usr/local/sbin/webalizer_french /usr/local/sbin/webalizer
  1235.     else
  1236.       ln -s /usr/local/sbin/webalizer_english /usr/local/sbin/webalizer
  1237.     fi
  1238.          
  1239.     /usr/local/sbin/webalizer
  1240.  
  1241.     # Very little bugfix of a previous update
  1242.     touch /var/log/mysql.log
  1243.  
  1244.     touch $UPDDIR/2.x-66
  1245.     logger -t "$LOGTAG" "Update 2.x-66 Done."
  1246.   else
  1247.     logger -t "$LOGTAG" "Update 2.x-66 FAILED."
  1248.   fi
  1249. fi
  1250. ###
  1251.  
  1252. ############################################################################
  1253. ### Update 2.x-67 - 10/06/2002
  1254. # Bug fix: ADSL was not supported by port redirection function
  1255. # Obsoletes :
  1256. ############################################################################
  1257.  
  1258. if [ ! \( -e $UPDDIR/2.x-67 \) ]
  1259. then
  1260.  
  1261.   # Download the files
  1262.   cd /tmp
  1263.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-67.tgz .
  1264.  
  1265.   # Do the things...
  1266.   tar zxf upd-2.x-67.tgz --directory /
  1267.   RC=$?
  1268.   /usr/local/sbin/permslis
  1269.  
  1270.   # Check and finish
  1271.   if [ $RC = 0 ]
  1272.   then
  1273.  
  1274.     touch $UPDDIR/2.x-67
  1275.     logger -t "$LOGTAG" "Update 2.x-67 Done."
  1276.   else
  1277.     logger -t "$LOGTAG" "Update 2.x-67 FAILED."
  1278.   fi
  1279. fi
  1280. ###
  1281.  
  1282. ############################################################################
  1283. ### Update 2.x-68 - 25/06/2002
  1284. # SECURITY: apache
  1285. # Obsoletes :
  1286. ############################################################################
  1287.  
  1288. if [ ! \( -e $UPDDIR/2.x-68 \) ]
  1289. then
  1290.  
  1291.   # Download the files
  1292.   cd /tmp
  1293.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/apache-1.3.22-5.6.i386.rpm .
  1294.  
  1295.   # Do the things...
  1296.   rpm -U apache-1.3.22-5.6.i386.rpm
  1297.   RC=$?
  1298.  
  1299.   # Check and finish
  1300.   if [ $RC = 0 ]
  1301.   then
  1302.     touch $UPDDIR/2.x-68
  1303.     # Httpd restarting
  1304.     /etc/rc.d/init.d/httpd stop
  1305.     killall httpd
  1306.     sleep 5
  1307.     export PHPRC="/etc"
  1308.     /etc/rc.d/init.d/httpd start
  1309.     export PHPRC="/etc/hadmin";/usr/sbin/httpd -f /etc/hadmin/conf/httpd.conf;export -n PHPRC
  1310.     export PHPRC="/etc/hadmin";/usr/sbin/httpd -f /etc/hadmin/clientgw/conf/httpd.conf;export -n PHPRC
  1311.     logger -t "$LOGTAG" "Update 2.x-68 Done."
  1312.   else
  1313.     logger -t "$LOGTAG" "Update 2.x-68 FAILED."
  1314.   fi
  1315. fi
  1316. ###
  1317.  
  1318. ############################################################################
  1319. ### Update 2.x-69 - 25/06/2002
  1320. # SECURITY: imap, fetchmail
  1321. # Obsoletes :
  1322. ############################################################################
  1323.  
  1324. if [ ! \( -e $UPDDIR/2.x-69 \) ]
  1325. then
  1326.  
  1327.   # Download the files
  1328.   cd /tmp
  1329.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/imap-2001a-1.62.0.i386.rpm .
  1330.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/fetchmail-5.9.0-9.i386.rpm .
  1331.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/tcpdump-3.6.2-11.6.2.0.i386.rpm .
  1332.  
  1333.   # Do the things...
  1334.   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
  1335.   RC=$?
  1336.  
  1337.   # Check and finish
  1338.   if [ $RC = 0 ]
  1339.   then
  1340.     touch $UPDDIR/2.x-69
  1341.     logger -t "$LOGTAG" "Update 2.x-69 Done."
  1342.   else
  1343.     logger -t "$LOGTAG" "Update 2.x-69 FAILED."
  1344.   fi
  1345. fi
  1346. ###
  1347.  
  1348. ############################################################################
  1349. ### Update 2.x-70 - 25/06/2002
  1350. # Bug fix: config_pgsl.inc.php must be world readable if we want IMP working
  1351. # and webmaster's scripts able to use it, because of safe mode. It's not a
  1352. # problem since there's only one webmaster for the moment. Later, we'll have
  1353. # to use a doublon of this file.
  1354. # Obsoletes :
  1355. ############################################################################
  1356.  
  1357. if [ ! \( -e $UPDDIR/2.x-70 \) ]
  1358. then
  1359.  
  1360.   # Download the update
  1361.   cd /tmp
  1362.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-70.tgz .
  1363.  
  1364.   # Untaring
  1365.   tar zxf upd-2.x-70.tgz --directory /
  1366.   RC=$?
  1367.   /usr/local/sbin/permslis
  1368.  
  1369.   # Make a backup of config_pgsl.inc.php
  1370.   cp /home/httpd/html/config_pgsql.inc.php /home/hadmin/
  1371.  
  1372.   # Check and finish
  1373.   if [ $RC = 0 ]
  1374.   then
  1375.     touch $UPDDIR/2.x-70
  1376.     logger -t "$LOGTAG" "Update 2.x-70 Done."
  1377.   else
  1378.     logger -t "$LOGTAG" "Update 2.x-70 FAILED."
  1379.   fi
  1380. fi
  1381. ###
  1382.  
  1383. ############################################################################
  1384. ### Update 2.x-71 - 09/07/2002
  1385. # SECURITY: squid
  1386. # We use squid from RPM now, so a few more symlinks are created (I like
  1387. # spaghettis!)
  1388. # Obsoletes :
  1389. ############################################################################
  1390.  
  1391. if [ ! \( -e $UPDDIR/2.x-71 \) ]
  1392. then
  1393.  
  1394.   # Download the files
  1395.   cd /tmp
  1396.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/squid-2.4.STABLE6-6.6.2.i386.rpm .
  1397.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-71.tgz .
  1398.  
  1399.   # Do the things...
  1400.   rpm -e squid 2>/dev/null
  1401.   rpm -U squid-2.4.STABLE6-6.6.2.i386.rpm
  1402.   RC1=$?
  1403.   tar zxf upd-2.x-71.tgz --directory /
  1404.   RC2=$?
  1405.  
  1406.   # Check and finish
  1407.   if [ $RC1 = 0 -a $RC2 = 0 ]
  1408.   then
  1409.     touch $UPDDIR/2.x-71
  1410.     /etc/rc.d/init.d/runcache stop
  1411.     killall -9 RunCache;killall -9 squid;sleep 3
  1412.     rm -f /etc/squid/squid.conf
  1413.     ln -s /usr/local/squid/etc/squid.conf /etc/squid/squid.conf
  1414.     rm -rf /var/log/squid
  1415.     ln -s /usr/local/squid/logs /var/log/squid
  1416.     mv -f /usr/local/squid/bin/squid /usr/local/squid/bin/squid.orig
  1417.     ln -s /usr/sbin/squid /usr/local/squid/bin/squid
  1418.     /etc/rc.d/init.d/runcache start
  1419.  
  1420.     logger -t "$LOGTAG" "Update 2.x-71 Done."
  1421.   else
  1422.     logger -t "$LOGTAG" "Update 2.x-71 FAILED."
  1423.   fi
  1424. fi
  1425. ###
  1426.  
  1427. ############################################################################
  1428. ### Update 2.x-72 - 09/07/2002
  1429. # Unused packages removal (preventive security)
  1430. # Obsoletes :
  1431. ############################################################################
  1432.  
  1433. if [ ! \( -e $UPDDIR/2.x-72 \) ]
  1434. then
  1435.  
  1436.   rpm -e inews
  1437.   rpm -e binutils
  1438.   rpm -e pnm2ppa
  1439.   rpm -e utempter
  1440.   rpm -e dosfstools
  1441.   rpm -e rdist
  1442.   rpm -e rsh
  1443.  
  1444.   touch $UPDDIR/2.x-72
  1445.   logger -t "$LOGTAG" "Update 2.x-72 Done."
  1446. fi
  1447. ###
  1448.  
  1449. ############################################################################
  1450. ### Update 2.x-73 - 06/09/2002
  1451. # Bug fix: Creating users may be impossible after a restore from scracth
  1452. # Obsoletes :
  1453. ############################################################################
  1454.  
  1455. if [ ! \( -e $UPDDIR/2.x-73 \) ]
  1456. then
  1457.  
  1458.   # Download the files
  1459.   cd /tmp
  1460.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-73.tgz .
  1461.  
  1462.   # Do the things...
  1463.   tar zxf upd-2.x-73.tgz --directory /
  1464.   RC=$?
  1465.   /usr/local/sbin/permslis
  1466.  
  1467.   # Check and finish
  1468.   if [ $RC = 0 ]
  1469.   then
  1470.  
  1471.     /usr/local/sbin/fix_tables
  1472.  
  1473.     touch $UPDDIR/2.x-73
  1474.     logger -t "$LOGTAG" "Update 2.x-73 Done."
  1475.   else
  1476.     logger -t "$LOGTAG" "Update 2.x-73 FAILED."
  1477.   fi
  1478. fi
  1479. ###
  1480.  
  1481. ############################################################################
  1482. ### Update 2.x-74 - 14/10/2002
  1483. # SECURITY
  1484. # Obsoletes :
  1485. ############################################################################
  1486.  
  1487. declare -i HOUR
  1488. declare -i R
  1489. HOUR=`date +%k`
  1490. R=$RANDOM
  1491. # "$R -lt 3277" in the following line means that this update
  1492. # will be executed with a probability of 1/10. This is done to
  1493. # prevent an overload of the rsync server.
  1494. # To be sure that all your SLIS are up to date, remove this part
  1495. # of the test in a couple of weeks, commenting this line and
  1496. # commenting out the next one.
  1497. #if [ ! \( -e $UPDDIR/2.x-74 \) -a $HOUR -lt 6 -a $R -lt 3277 ]
  1498. if [ ! \( -e $UPDDIR/2.x-74 \) ]
  1499. then
  1500.  
  1501.   # Clean /tmp as we need some space
  1502.   /usr/sbin/tmpwatch -f 720 /tmp/
  1503.   rm -f /tmp/kernel*
  1504.  
  1505.   # Download the files
  1506.   cd /tmp
  1507.     # Obsoleted by 2.x-80:
  1508.   # rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/glibc-2.1.3-27.i386.rpm .
  1509.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/fetchmail-5.9.0-18.i386.rpm .
  1510.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/tar-1.13.25-1.6.i386.rpm .
  1511.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/unzip-5.50-1.62.i386.rpm .
  1512.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/libpng-1.0.14-0.6x.3.i386.rpm .
  1513.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/tcpdump-3.6.2-11.6.2.2.i386.rpm .
  1514.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/krb5-libs-1.1.1-29.i386.rpm .
  1515.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/krb5-configs-1.1.1-29.i386.rpm .
  1516.  
  1517.   # Do the things...
  1518.   rpm -U fetchmail-5.9.0-18.i386.rpm \
  1519.    tar-1.13.25-1.6.i386.rpm unzip-5.50-1.62.i386.rpm \
  1520.    libpng-1.0.14-0.6x.3.i386.rpm tcpdump-3.6.2-11.6.2.2.i386.rpm \
  1521.    krb5-libs-1.1.1-29.i386.rpm krb5-configs-1.1.1-29.i386.rpm
  1522.   RC=$?
  1523.  
  1524.   # Check and finish
  1525.   if [ $RC = 0 ]
  1526.   then
  1527.     touch $UPDDIR/2.x-74
  1528.     logger -t "$LOGTAG" "Update 2.x-74 Done."
  1529.   else
  1530.     logger -t "$LOGTAG" "Update 2.x-74 FAILED."
  1531.   fi
  1532. fi
  1533. ###
  1534.  
  1535. ############################################################################
  1536. ### Update 2.x-75b - 02/04/2003
  1537. # SECURITY: openssl
  1538. # Obsoletes : 2.x-75
  1539. ############################################################################
  1540.  
  1541. if [ ! \( -e $UPDDIR/2.x-75b \) ]
  1542. then
  1543.  
  1544.   # Download the files
  1545.   cd /tmp
  1546.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openssl-0.9.6b-32.62.i386.rpm .
  1547.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openssl095a-0.9.5a-20.62.i386.rpm .
  1548.  
  1549.   # Do the things...
  1550.   rpm -F --nodeps openssl-0.9.6b-32.62.i386.rpm \
  1551.                   openssl095a-0.9.5a-20.62.i386.rpm
  1552.   RC1=$?
  1553.  
  1554.   # Check and finish
  1555.   if [ $RC1 = 0 ]
  1556.   then
  1557.     ln -s /lib/libcrypto.so.0.9.6b /lib/libcrypto.so.1 2>/dev/null
  1558.     /etc/rc.d/init.d/sshd restart
  1559.     touch $UPDDIR/2.x-75b
  1560.     logger -t "$LOGTAG" "Update 2.x-75b Done."
  1561.   else
  1562.     logger -t "$LOGTAG" "Update 2.x-75b FAILED."
  1563.   fi
  1564. fi
  1565. ###
  1566.  
  1567. ############################################################################
  1568. ### Update 2.x_3.x-01 - 21/10/2002
  1569. # Enhancement: Backup/Restore takes now ldap passwords into account
  1570. # Obsoletes :
  1571. ############################################################################
  1572.  
  1573. if [ ! \( -e $UPDDIR/2.x_3.x-01 \) ]
  1574. then
  1575.  
  1576.   # Download the files
  1577.   cd /tmp
  1578.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x_3.x-01.tgz .
  1579.  
  1580.   # Do the things...
  1581.   tar zxf upd-2.x_3.x-01.tgz --exclude usr/local/ --directory /
  1582.   RC=$?
  1583.   /usr/local/sbin/permslis
  1584.  
  1585.   # Check and finish
  1586.   if [ $RC = 0 ]
  1587.   then
  1588.     touch $UPDDIR/2.x_3.x-01
  1589.     logger -t "$LOGTAG" "Update 2.x_3.x-01 Done."
  1590.   else
  1591.     logger -t "$LOGTAG" "Update 2.x_3.x-01 FAILED."
  1592.   fi
  1593. fi
  1594. ###
  1595.  
  1596. ############################################################################
  1597. ### Update 2.x-76 - 08/11/2002
  1598. # Bug fixes / Enhancements:
  1599. # - Set php max_execution_time to 10 minutes, for hadmin
  1600. # - Allow .htaccess file creation into /home/httpd/html for authconfigs
  1601. # - Added a rm of /var/lib/logrotate.status if empty into squid_rotate
  1602. # - Fixed a little bug into administrator.php (erase of hadmin http users
  1603. # that contain "admin") thanks to Rennes
  1604. # - Fixed the bug for too long urls into accesslog2sql
  1605. # Obsoletes :
  1606. ############################################################################
  1607.  
  1608. if [ ! \( -e $UPDDIR/2.x-76 \) ]
  1609. then
  1610.  
  1611.   # Increase the php max execution time for hadmin
  1612.   cp -f /etc/hadmin/php.ini /etc/hadmin/php.ini.upd-2.x-76
  1613.   perl -pi -e 's/max_execution_time.*=.*/max_execution_time = 600/' /etc/hadmin/php.ini
  1614.  
  1615.   # New httpd.conf and squid_rotate
  1616.   cp -f /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.upd-2.x-76
  1617.   cd /tmp
  1618.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-76.tgz .
  1619.   tar zxf upd-2.x-76.tgz --exclude usr/local/ --directory /
  1620.   RC=$?
  1621.   /usr/local/sbin/permslis
  1622.  
  1623.   # Check and finish
  1624.   if [ $RC = 0 ]
  1625.   then
  1626.     killall -HUP httpd
  1627.     touch $UPDDIR/2.x-76
  1628.     logger -t "$LOGTAG" "Update 2.x-76 Done."
  1629.   else
  1630.     logger -t "$LOGTAG" "Update 2.x-76 FAILED."
  1631.   fi
  1632. fi
  1633. ###
  1634.  
  1635. ############################################################################
  1636. ### Update 2.x-77 - 13/11/2002
  1637. # SECURITY: bind
  1638. # Enhancement: upgrade to bind 9: same config as for SLIS 3.0, with views
  1639. # (new mknamedconf)
  1640. # WARNING: you have to set the variable "DEFAULT_DNS" at the top of
  1641. # this update.
  1642. # CAUTION: UPDATE IS NOT DONE IF KERNEL VERSION < 2.2.19 !!
  1643. # Obsoletes :
  1644. ############################################################################
  1645.  
  1646. declare -i KREL=`uname -r |cut -f1 -d-|sed s"/\.//g"`
  1647. if [ $KREL -lt 2219 ]
  1648. then
  1649.   logger -t "$LOGTAG" "ALERT: Update 2.x-77 SKIPPED BECAUSE KERNEL IS NOT UP TO DATE!"
  1650.   logger -t "$LOGTAG" "ALERT: update kernel to 2.2.19 or newer, you have big security holes!"
  1651. else
  1652.  if [ ! \( -e $UPDDIR/2.x-77 \) ]
  1653.  then
  1654.  
  1655.   DEFAULT_DNS=193.54.149.10     # Only used if actual nameserver config
  1656.                                 # could not be guessed.
  1657.  
  1658.   # Download the files
  1659.   cd /tmp
  1660.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-77.tgz .
  1661.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/bind-9.2.1-0.6x.3.i386.rpm .
  1662.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/bind-utils-9.2.1-0.6x.3.i386.rpm .
  1663.  
  1664.   # Do the things...
  1665.   tar zxf upd-2.x-77.tgz --directory /
  1666.   rpm -F bind-9.2.1-0.6x.3.i386.rpm bind-utils-9.2.1-0.6x.3.i386.rpm
  1667.   RC=$?
  1668.   /usr/local/sbin/permslis
  1669.  
  1670.   # Check and finish
  1671.   if [ $RC = 0 ]
  1672.   then
  1673.  
  1674.     # Actual DNS configuration guessing
  1675.     FORWARDERS=`grep forwarders /etc/named.conf \
  1676.                 |head -1|awk -F'[{;}]' '{print $2 " " $3}'`
  1677.     NS1=`echo $FORWARDERS|awk '{print $1'} \
  1678.          |egrep "^[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}"`
  1679.     NS2=`echo $FORWARDERS|awk '{print $2'} \
  1680.          |egrep "^[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}"`
  1681.  
  1682.     # Adding missing variables if needed
  1683.  
  1684.     # DNS_PRIMARY
  1685.     if [ "`grep DNS_PRIMARY /home/hadmin/slis.conf.pl`" = "" ]
  1686.     then
  1687.       if [ "$NS1" != "" ]
  1688.       then
  1689.         echo "DNS_PRIMARY=$NS1" >> /home/hadmin/slis.conf
  1690.         echo "\$DNS_PRIMARY=\"$NS1\";" >> /home/hadmin/slis.conf.pl
  1691.       else
  1692.         echo "DNS_PRIMARY=$DEFAULT_DNS" >> /home/hadmin/slis.conf
  1693.         echo "\$DNS_PRIMARY=\"$DEFAULT_DNS\";" >> /home/hadmin/slis.conf.pl
  1694.       fi
  1695.     fi
  1696.  
  1697.     # DNS_SECONDARY
  1698.     if [ "`grep DNS_SECONDARY /home/hadmin/slis.conf.pl`" = "" ]
  1699.     then
  1700.       if [ "$NS2" != "" ]
  1701.       then
  1702.         echo "DNS_SECONDARY=$NS2" >> /home/hadmin/slis.conf
  1703.         echo "\$DNS_SECONDARY=\"$NS2\";" >> /home/hadmin/slis.conf.pl
  1704.       else
  1705.         if [ "$NS1" != "" ]
  1706.         then
  1707.           echo "DNS_SECONDARY=$NS1" >> /home/hadmin/slis.conf
  1708.           echo "\$DNS_SECONDARY=\"$NS1\";" >> /home/hadmin/slis.conf.pl
  1709.         else
  1710.           echo "DNS_SECONDARY=$DEFAULT_DNS" >> /home/hadmin/slis.conf
  1711.           echo "\$DNS_SECONDARY=\"$DEFAULT_DNS\";" >> /home/hadmin/slis.conf.pl
  1712.         fi
  1713.       fi
  1714.     fi
  1715.  
  1716.     # GATEWAY
  1717.     if [ "`grep GATEWAY /home/hadmin/slis.conf.pl`" = "" ]
  1718.     then
  1719.       GATEWAY=`grep "ROUTEUR=" /home/hadmin/slis.conf.pl |cut -f2 -d\"`
  1720.       echo "\$GATEWAY=\"$GATEWAY\";" >> /home/hadmin/slis.conf.pl
  1721.     fi
  1722.  
  1723.     # ROUTER_TYPE
  1724.     if [ "`grep ROUTER_TYPE /home/hadmin/slis.conf.pl`" = "" ]
  1725.     then
  1726.       if [ "`ps awux |grep pppoe|grep -v grep`" != "" ]
  1727.       then
  1728.         echo "\$ROUTER_TYPE=\"9\";" >> /home/hadmin/slis.conf.pl
  1729.       fi
  1730.     fi
  1731.  
  1732.     # Zones creation
  1733.     /usr/local/sbin/mknamedzones
  1734.  
  1735.     # For a SLIS pppoe in auto mode, we need to restart the connection to force
  1736.     # a DNS reconfiguration
  1737.     if [ "`ps awux |grep pppoe|grep -v grep`" != "" -a \
  1738.          "`egrep "DNS_PRIMARY.*auto" /home/hadmin/slis.conf.pl`" != "" ]
  1739.     then
  1740.       killall pppoe 2>/dev/null
  1741.       sleep 30
  1742.     # Else, we restart normaly
  1743.     else
  1744.       cp -f /etc/named.conf /etc/named.conf.upd-2.x-77
  1745.       /usr/local/sbin/mknamedconf > /etc/named.conf
  1746.       /etc/rc.d/init.d/named restart
  1747.     fi
  1748.  
  1749.     touch $UPDDIR/2.x-77
  1750.     logger -t "$LOGTAG" "Update 2.x-77 Done."
  1751.   else
  1752.     logger -t "$LOGTAG" "Update 2.x-77 FAILED."
  1753.   fi
  1754.   sleep 60
  1755.  fi
  1756. fi
  1757. ###
  1758.  
  1759. ############################################################################
  1760. ### Update 2.x-78b - 27/11/2002
  1761. # Kernel update
  1762. # !! THIS UPDATE WILL BE DONE ONLY BY NIGHT AS IT IS A KERNEL UPDATE !!
  1763. # !! WHICH WILL REBOOT THE MACHINE                                   !!
  1764. # Obsoletes : 2.x-63, 2.x-78
  1765. ############################################################################
  1766.  
  1767. declare -i HOUR
  1768. declare -i R
  1769. HOUR=`date +%k`
  1770. R=$RANDOM
  1771. # "$R -lt 3277" in the following line means that this update
  1772. # will be executed with a probability of 1/10. This is done to
  1773. # prevent an overload of the rsync server.
  1774. # To be sure that all your SLIS are up to date, remove this part
  1775. # of the test in a couple of weeks, commenting this line and
  1776. # commenting out the next one.
  1777. #if [ ! \( -e $UPDDIR/2.x-78b \) -a $HOUR -lt 6 -a $R -lt 3277 ]
  1778. if [ ! \( -e $UPDDIR/2.x-78b \) -a $HOUR -lt 6 ]
  1779. then
  1780.  
  1781.   if [ "`/bin/uname -v|/bin/grep SMP`" = "" ]
  1782.   then
  1783.     SMP=""
  1784.     SMP2=""
  1785.   else
  1786.     SMP="-smp"
  1787.     SMP2="smp"
  1788.   fi
  1789.  
  1790.   PROC=`/bin/uname -m`
  1791.   if [ "$PROC" = "i486" ]
  1792.   then
  1793.     PROC="i386"
  1794.   fi
  1795.  
  1796.   . /home/hadmin/setup.data
  1797.   SMP3=""
  1798.   if [ "$VTUN" = "1" ]
  1799.   then
  1800.     SMP="-smp"
  1801.     SMP2="smp"
  1802.     SMP3="smp"
  1803.   fi
  1804.  
  1805.   RELEASE=`/bin/uname -r |sed s/smp//`
  1806.   # Some 2.1 have a bugged lilo.conf:
  1807.   if [ "$RELEASE" = "2.2.19-6.2.1" -o "$RELEASE" = "2.2.19-6.2.1smp" ]
  1808.   then
  1809.     perl -pi -e 's/2.2.19-6.2.16/2.2.19-6.2.1/' /etc/lilo.conf
  1810.   fi
  1811.  
  1812.   cd /tmp
  1813.   rm -f kernel-*
  1814.   rm -f glibc-*
  1815.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/kernel`echo $SMP`-2.2.22-6.2.3.`echo $PROC`.rpm .
  1816.   RC=$?
  1817.  
  1818.   /sbin/insmod loop
  1819.   rpm --rebuilddb
  1820.   rpm -e kernel-utils 2>/dev/null
  1821.   if [ -e $UPDDIR/2.x-78 ]
  1822.   then
  1823.     rpm -U kernel`echo $SMP`-2.2.22-6.2.3.`echo $PROC`.rpm
  1824.   else
  1825.     # Keep the old kernel in case of a problem
  1826.     rpm -i kernel`echo $SMP`-2.2.22-6.2.3.`echo $PROC`.rpm
  1827.   fi
  1828.   cd /lib/modules/2.2.22-6.2.3`echo $SMP2`/net
  1829.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/tun.o.2.2.22-6.2.3 ./tun.o
  1830.  
  1831.   if [ $RC = 0 ]
  1832.   then
  1833.     /sbin/mkinitrd /boot/initrd-2.2.22-6.2.3.img 2.2.22-6.2.3 2>/dev/null
  1834.     /sbin/mkinitrd /boot/initrd-2.2.22-6.2.3smp.img 2.2.22-6.2.3smp 2>/dev/null
  1835.     sed "s/$RELEASE/2.2.22-6.2.3/g" /etc/lilo.conf > /tmp/lilo.conf
  1836.     if [ -s /tmp/lilo.conf ]
  1837.     then
  1838.       mv -f /tmp/lilo.conf /etc/lilo.conf
  1839.       /sbin/lilo; LILORC=$?
  1840.       rm -f /var/lock/slis_upd*
  1841.       touch $UPDDIR/2.x-78b
  1842.       logger -t "$LOGTAG" "Update 2.x-78b Done."
  1843.       if [ $LILORC = 0 ]
  1844.       then
  1845.         /sbin/reboot
  1846.       else
  1847.         logger -t "$LOGTAG" "Update 2.x-78b: ERROR INTO LILO CONFIG"
  1848.         echo "$HOSTNAME problem with lilo" | mail -s "ERREUR MAJ 2.x-78b" $SLISMASTER
  1849.       fi
  1850.       killall slis_update
  1851.       killall slis_update.dev
  1852.       exit
  1853.     fi
  1854.   else
  1855.     logger -t "$LOGTAG" "Update 2.x-78b FAILED."
  1856.   fi
  1857. fi
  1858. ###
  1859.  
  1860.  
  1861. ############################################################################
  1862. ### Update 2.x-79 - 22/11/2002
  1863. # SECURITY: krb5 and ypserv
  1864. # Obsoletes :
  1865. ############################################################################
  1866.  
  1867. if [ ! \( -e $UPDDIR/2.x-79 \) ]
  1868. then
  1869.  
  1870.   # Download the files
  1871.   cd /tmp
  1872.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/krb5-libs-1.1.1-30.i386.rpm .
  1873.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/krb5-configs-1.1.1-30.i386.rpm .
  1874.  
  1875.   # Do the things...
  1876.   rpm -e ypserv 2>/dev/null
  1877.   rpm -F krb5-libs-1.1.1-30.i386.rpm krb5-configs-1.1.1-30.i386.rpm
  1878.   RC=$?
  1879.  
  1880.   # Check and finish
  1881.   if [ $RC = 0 ]
  1882.   then
  1883.     touch $UPDDIR/2.x-79
  1884.     logger -t "$LOGTAG" "Update 2.x-79 Done."
  1885.   else
  1886.     logger -t "$LOGTAG" "Update 2.x-79 FAILED."
  1887.   fi
  1888. fi
  1889. ###
  1890.  
  1891. ############################################################################
  1892. ### Update 2.x-80 - 28/11/2002
  1893. # SECURITY: https://rhn.redhat.com/errata/RHSA-2002-197.html
  1894. # Obsoletes : A part of 2.x-74
  1895. ############################################################################
  1896.  
  1897. declare -i HOUR
  1898. declare -i R
  1899. HOUR=`date +%k`
  1900. R=$RANDOM
  1901. # "$R -lt 3277" in the following line means that this update
  1902. # will be executed with a probability of 1/10. This is done to
  1903. # prevent an overload of the rsync server.
  1904. # To be sure that all your SLIS are up to date, remove this part
  1905. # of the test in a couple of weeks, commenting this line and
  1906. # commenting out the next one.
  1907. if [ ! \( -e $UPDDIR/2.x-80 \) -a $HOUR -lt 6 -a $R -lt 3277 ]
  1908. #if [ ! \( -e $UPDDIR/2.x-80 \) ]
  1909. then
  1910.  
  1911.   # Clean /tmp as we need some space
  1912.   /usr/sbin/tmpwatch -f 720 /tmp/
  1913.   rm -f /tmp/kernel*
  1914.  
  1915.   # Download the files
  1916.   cd /tmp
  1917.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/glibc-2.1.3-28.i386.rpm .
  1918.  
  1919.   # Do the things...
  1920.   rpm -F glibc-2.1.3-28.i386.rpm
  1921.   RC=$?
  1922.  
  1923.   # Check and finish
  1924.   if [ $RC = 0 ]
  1925.   then
  1926.     touch $UPDDIR/2.x-80
  1927.     logger -t "$LOGTAG" "Update 2.x-80 Done."
  1928.   else
  1929.     logger -t "$LOGTAG" "Update 2.x-80 FAILED."
  1930.   fi
  1931. fi
  1932. ###
  1933.  
  1934. ############################################################################
  1935. ### Update 2.x-81 - 06/12/2002
  1936. # Bug fix: Passwd changing does not work when supplied password is >8 chars
  1937. # Obsoletes : 2.x_3.x-02: it was not good for 2.x version, only 3.x working.
  1938. ############################################################################
  1939.  
  1940. if [ ! \( -e $UPDDIR/2.x-81 \) ]
  1941. then
  1942.  
  1943.   # Download the files
  1944.   cd /tmp
  1945.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-81.tgz .
  1946.  
  1947.   # Do the things...
  1948.   tar zxf upd-2.x-81.tgz --directory /
  1949.   RC=$?
  1950.   /usr/local/sbin/permslis
  1951.  
  1952.   # Check and finish
  1953.   if [ $RC = 0 ]
  1954.   then
  1955.  
  1956.     touch $UPDDIR/2.x-81
  1957.     logger -t "$LOGTAG" "Update 2.x-81 Done."
  1958.   else
  1959.     logger -t "$LOGTAG" "Update 2.x-81 FAILED."
  1960.   fi
  1961. fi
  1962. ###
  1963.  
  1964. ############################################################################
  1965. ### Update 2.x-82 - 06/12/2002
  1966. # Security: Secure sshd configuration, thanks to Pierre Barabagelata (Nice)
  1967. # Obsoletes :
  1968. ############################################################################
  1969. if [ ! \( -e $UPDDIR/2.x-82 \) ]
  1970. then
  1971.   perl -pi -e 's/#ChallengeResponseAuthentication yes/ChallengeResponseAuthentication no/' /etc/ssh/sshd_config
  1972.   perl -pi -e 's/#PAMAuthenticationViaKbdInt yes/PAMAuthenticationViaKbdInt no/' /etc/ssh/sshd_config
  1973.   /etc/rc.d/init.d/sshd restart
  1974.  
  1975.   touch $UPDDIR/2.x-82
  1976.   logger -t "$LOGTAG" "Update 2.x-82 Done."
  1977. fi
  1978. ###
  1979.  
  1980. ############################################################################
  1981. ### Update 2.x-83 - 11/12/2002
  1982. # Security: https://rhn.redhat.com/errata/RHSA-2002-229.html
  1983. # Obsoletes :
  1984. ############################################################################
  1985.  
  1986. if [ ! \( -e $UPDDIR/3.x-83 -o -e $UPDDIR/2.x-83 \) ]
  1987. then
  1988.  
  1989.   # Download the files
  1990.   cd /tmp
  1991.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/wget-1.8.2-4.6x.i386.rpm .
  1992.  
  1993.   # Do the things...
  1994.   rpm -F wget-1.8.2-4.6x.i386.rpm
  1995.   RC1=$?
  1996.  
  1997.   # Check and finish
  1998.   if [ $RC1 = 0 ]
  1999.   then
  2000.     touch $UPDDIR/2.x-83
  2001.     logger -t "$LOGTAG" "Update 2.x-83 Done."
  2002.   else
  2003.     logger -t "$LOGTAG" "Update 2.x-83 FAILED."
  2004.   fi
  2005. fi
  2006. ###
  2007.  
  2008. ############################################################################
  2009. ### Update 2.x-84 - 17/12/2002
  2010. # Security: Apache update: https://rhn.redhat.com/errata/RHSA-2002-222.html
  2011. # Obsoletes :
  2012. ############################################################################
  2013.  
  2014. if [ ! \( -e $UPDDIR/2.x-84 \) ]
  2015. then
  2016.  
  2017.   # Download the files
  2018.   cd /tmp
  2019.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/apache-1.3.27-1.6.2.i386.rpm .
  2020.  
  2021.   # Do the things...
  2022.   if [ -e /home/httpd/html/index.html ]
  2023.   then
  2024.     INDEX_EXISTS=1
  2025.   else
  2026.     INDEX_EXISTS=0
  2027.   fi
  2028.   rpm -F apache-1.3.27-1.6.2.i386.rpm
  2029.   RC1=$?
  2030.  
  2031.   # Check and finish
  2032.   if [ $RC1 = 0 ]
  2033.   then
  2034.     # This is to prevent the apache test page from appearing instead of
  2035.     # an already index.php or index.htm present page:
  2036.     if [ $INDEX_EXISTS = 0 ]
  2037.     then
  2038.       mv -f /home/httpd/html/index.html /home/httpd/html/index.html.rpm 2>/dev/null
  2039.     fi
  2040.  
  2041.     /etc/rc.d/init.d/httpd stop > /dev/null
  2042.     killall httpd 2> /dev/null
  2043.     sleep 5
  2044.     killall -9 httpd 2> /dev/null
  2045.     sleep 2
  2046.     /etc/rc.d/init.d/httpd start > /dev/null
  2047.     export PHPRC="/etc/hadmin";/usr/sbin/httpd -f /etc/hadmin/conf/httpd.conf;export -n PHPRC
  2048.     export PHPRC=/etc/hadmin;/usr/sbin/httpd -f /etc/hadmin/clientgw/conf/httpd.conf;export -n PHPRC
  2049.  
  2050.     touch $UPDDIR/2.x-84
  2051.     logger -t "$LOGTAG" "Update 2.x-84 Done."
  2052.   else
  2053.     logger -t "$LOGTAG" "Update 2.x-84 FAILED."
  2054.   fi
  2055. fi
  2056. ###
  2057.  
  2058. ############################################################################
  2059. ### Update 2.x-85 - 18/12/2002
  2060. # Security: https://rhn.redhat.com/errata/RHSA-2002-293.html
  2061. # Obsoletes :
  2062. ############################################################################
  2063.  
  2064. if [ ! \( -e $UPDDIR/2.x-85 \) ]
  2065. then
  2066.  
  2067.   # Download the files
  2068.   cd /tmp
  2069.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/fetchmail-5.9.0-21.6.2.i386.rpm .
  2070.  
  2071.   # Do the things...
  2072.   rpm -F fetchmail-5.9.0-21.6.2.i386.rpm
  2073.   RC1=$?
  2074.  
  2075.   # Check and finish
  2076.   if [ $RC1 = 0 ]
  2077.   then
  2078.     touch $UPDDIR/2.x-85
  2079.     logger -t "$LOGTAG" "Update 2.x-85 Done."
  2080.   else
  2081.     logger -t "$LOGTAG" "Update 2.x-85 FAILED."
  2082.   fi
  2083. fi
  2084. ###
  2085.  
  2086. ############################################################################
  2087. ### Update 2.x-86 - 19/12/2002
  2088. # Bug fix: Safe mode restriction did not allowed inclusion of config_pgsql.inc.php
  2089. # from custom php scripts and webmail working at the same time because of
  2090. # permissions on this file.
  2091. # Obsoletes:
  2092. ############################################################################
  2093.  
  2094. if [ ! \( -e $UPDDIR/2.x-86 \) ]
  2095. then
  2096.  
  2097.   # Download the files
  2098.   cd /tmp
  2099.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-86.tgz .
  2100.  
  2101.   # Do the things...
  2102.   tar zxf upd-2.x-86.tgz --directory /
  2103.   RC=$?
  2104.  
  2105.   cp -f /home/httpd/html/config_pgsql.inc.php /usr/share/php/
  2106.   perl -pi -e "s,\.\./\.\./config_pgsql\.inc\.php,config_pgsql.inc.php," /home/httpd/html/horde/imp/config/defaults.php3
  2107.   bash /usr/local/sbin/permslis
  2108.  
  2109.   # Check and finish
  2110.   if [ $RC = 0 ]
  2111.   then
  2112.  
  2113.     touch $UPDDIR/2.x-86
  2114.     logger -t "$LOGTAG" "Update 2.x-86 Done."
  2115.   else
  2116.     logger -t "$LOGTAG" "Update 2.x-86 FAILED."
  2117.   fi
  2118. fi
  2119. ###
  2120.  
  2121. ############################################################################
  2122. ### Update 2.x-89 - 07/02/2003
  2123. # Bug fix: logrotate not up to date, so apache log files are not rotated
  2124. # Obsoletes :
  2125. ############################################################################
  2126.  
  2127. if [ ! \( -e $UPDDIR/2.x-89 \) ]
  2128. then
  2129.  
  2130.   # Download the files
  2131.   cd /tmp
  2132.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/logrotate-3.5.2-0.6.i386.rpm .
  2133.  
  2134.   # Do the things...
  2135.   rpm -F logrotate-3.5.2-0.6.i386.rpm
  2136.   RC1=$?
  2137.  
  2138.   # Check and finish
  2139.   if [ $RC1 = 0 ]
  2140.   then
  2141.     touch $UPDDIR/2.x-89
  2142.     logger -t "$LOGTAG" "Update 2.x-89 Done."
  2143.   else
  2144.     logger -t "$LOGTAG" "Update 2.x-89 FAILED."
  2145.   fi
  2146. fi
  2147. ###
  2148.  
  2149. ############################################################################
  2150. ### Update 2.x-90 - 11/02/2003
  2151. # SECURITY:
  2152. # https://rhn.redhat.com/errata/RHSA-2003-006.html
  2153. # https://rhn.redhat.com/errata/RHSA-2002-297.html
  2154. # https://rhn.redhat.com/errata/RHSA-2003-020.html
  2155. # https://rhn.redhat.com/errata/RHSA-2003-040.html
  2156. # Obsoletes :
  2157. ############################################################################
  2158.  
  2159. if [ ! \( -e $UPDDIR/2.x-90 \) ]
  2160. then
  2161.  
  2162.   # Download the files
  2163.   cd /tmp
  2164.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/vim-common-6.1-18.6x.3.i386.rpm .
  2165.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/vim-minimal-6.1-18.6x.3.i386.rpm .
  2166.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/krb5-libs-1.1.1-32.i386.rpm .
  2167.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/krb5-configs-1.1.1-32.i386.rpm .
  2168.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openldap-1.2.13-2.i386.rpm .
  2169.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openldap-servers-1.2.13-2.i386.rpm .
  2170.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/libpng-1.0.14-0.6x.4.i386.rpm .
  2171.  
  2172.   # Do the things...
  2173.   rpm -F vim-common-6.1-18.6x.3.i386.rpm vim-minimal-6.1-18.6x.3.i386.rpm \
  2174.          krb5-libs-1.1.1-32.i386.rpm krb5-configs-1.1.1-32.i386.rpm \
  2175.          openldap-1.2.13-2.i386.rpm openldap-servers-1.2.13-2.i386.rpm \
  2176.          libpng-1.0.14-0.6x.4.i386.rpm
  2177.   RC1=$?
  2178.  
  2179.   # Check and finish
  2180.   if [ $RC1 = 0 ]
  2181.   then
  2182.     touch $UPDDIR/2.x-90
  2183.     logger -t "$LOGTAG" "Update 2.x-90 Done."
  2184.   else
  2185.     logger -t "$LOGTAG" "Update 2.x-90 FAILED."
  2186.   fi
  2187. fi
  2188. ###
  2189.  
  2190. ############################################################################
  2191. ### Update 2.x-91 - 21/02/2003
  2192. # SECURITY:
  2193. # https://rhn.redhat.com/errata/RHSA-2003-029.html
  2194. # https://rhn.redhat.com/errata/RHSA-2003-015.html
  2195. # Obsoletes :
  2196. ############################################################################
  2197.  
  2198. if [ ! \( -e $UPDDIR/2.x-91 \) ]
  2199. then
  2200.  
  2201.   # Download the files
  2202.   cd /tmp
  2203.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/lynx-2.8.3-2.1.i386.rpm .
  2204.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/fileutils-4.0-21.1.i386.rpm .
  2205.  
  2206.   # Do the things...
  2207.   rpm -F lynx-2.8.3-2.1.i386.rpm fileutils-4.0-21.1.i386.rpm
  2208.   RC1=$?
  2209.  
  2210.   # Check and finish
  2211.   if [ $RC1 = 0 ]
  2212.   then
  2213.     touch $UPDDIR/2.x-91
  2214.     logger -t "$LOGTAG" "Update 2.x-91 Done."
  2215.   else
  2216.     logger -t "$LOGTAG" "Update 2.x-91 FAILED."
  2217.   fi
  2218. fi
  2219. ###
  2220.  
  2221. ############################################################################
  2222. ### Update 2.x-92 - 19/03/2003
  2223. # SECURITY: sendmail, file
  2224. # Obsoletes :
  2225. ############################################################################
  2226.  
  2227. if [ ! \( -e $UPDDIR/2.x-92 \) ]
  2228. then
  2229.  
  2230.   # Download the files
  2231.   cd /tmp
  2232.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/sendmail-8.11.6-1.62.2.i386.rpm .
  2233.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/file-3.39-8.6x.i386.rpm .
  2234.  
  2235.   # Do the things...
  2236.   rpm -F sendmail-8.11.6-1.62.2.i386.rpm file-3.39-8.6x.i386.rpm
  2237.   RC1=$?
  2238.  
  2239.   # Check and finish
  2240.   if [ $RC1 = 0 ]
  2241.   then
  2242.     /etc/rc.d/init.d/sendmail restart
  2243.     touch $UPDDIR/2.x-92
  2244.     logger -t "$LOGTAG" "Update 2.x-92 Done."
  2245.   else
  2246.     logger -t "$LOGTAG" "Update 2.x-92 FAILED."
  2247.   fi
  2248. fi
  2249. ###
  2250.  
  2251. ############################################################################
  2252. ### Update 2.x-93 - 19/03/2003
  2253. # SECURITY: openssl
  2254. # Obsoletes :
  2255. ############################################################################
  2256.  
  2257. if [ ! \( -e $UPDDIR/2.x-93 \) ]
  2258. then
  2259.  
  2260.   # Download the files
  2261.   cd /tmp
  2262.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openssl-0.9.6b-30.62.i386.rpm .
  2263.  
  2264.   # Do the things...
  2265.   rpm -F --nodeps openssl-0.9.6b-30.62.i386.rpm
  2266.   RC1=$?
  2267.  
  2268.   # Check and finish
  2269.   if [ $RC1 = 0 ]
  2270.   then
  2271.     touch $UPDDIR/2.x-93
  2272.     logger -t "$LOGTAG" "Update 2.x-93 Done."
  2273.   else
  2274.     logger -t "$LOGTAG" "Update 2.x-93 FAILED."
  2275.   fi
  2276. fi
  2277. ###
  2278.  
  2279. ############################################################################
  2280. ### Update 2.x-80b - 20/03/2003
  2281. # SECURITY: https://rhn.redhat.com/errata/RHSA-2003-089.html
  2282. # Obsoletes : 2.x-80, a part of 2.x-74
  2283. ############################################################################
  2284.  
  2285. declare -i HOUR
  2286. declare -i R
  2287. HOUR=`date +%k`
  2288. R=$RANDOM
  2289. # "$R -lt 3277" in the following line means that this update
  2290. # will be executed with a probability of 1/10. This is done to
  2291. # prevent an overload of the rsync server.
  2292. # To be sure that all your SLIS are up to date, remove this part
  2293. # of the test in a couple of weeks, commenting this line and
  2294. # commenting out the next one.
  2295. if [ ! \( -e $UPDDIR/2.x-80b \) -a $HOUR -lt 6 -a $R -lt 3277 ]
  2296. #if [ ! \( -e $UPDDIR/2.x-80b \) ]
  2297. then
  2298.  
  2299.   # Clean /tmp as we need some space
  2300.   /usr/sbin/tmpwatch -f 720 /tmp/
  2301.   rm -f /tmp/kernel*
  2302.  
  2303.   # Download the files
  2304.   cd /tmp
  2305.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/glibc-2.1.3-29.i386.rpm .
  2306.  
  2307.   # Do the things...
  2308.   rpm -F glibc-2.1.3-29.i386.rpm
  2309.   RC=$?
  2310.  
  2311.   # Check and finish
  2312.   if [ $RC = 0 ]
  2313.   then
  2314.     touch $UPDDIR/2.x-80b
  2315.     logger -t "$LOGTAG" "Update 2.x-80b Done."
  2316.   else
  2317.     logger -t "$LOGTAG" "Update 2.x-80b FAILED."
  2318.   fi
  2319. fi
  2320. ###
  2321.  
  2322. ############################################################################
  2323. ### Update 2.x-94 - 01/04/2003
  2324. # SECURITY: sendmail, krb, samba
  2325. # Obsoletes :
  2326. ############################################################################
  2327.  
  2328. if [ ! \( -e $UPDDIR/2.x-94 \) ]
  2329. then
  2330.  
  2331.   # Download the files
  2332.   cd /tmp
  2333.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/sendmail-8.11.6-1.62.3.i386.rpm .
  2334.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/krb5-libs-1.1.1-40.i386.rpm .
  2335.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/krb5-configs-1.1.1-40.i386.rpm .
  2336.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/samba-2.0.10-1.62.i386.rpm .
  2337.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/samba-common-2.0.10-1.62.i386.rpm .
  2338.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/samba-client-2.0.10-1.62.i386.rpm .
  2339.  
  2340.   # Do the things...
  2341.   rpm -F sendmail-8.11.6-1.62.3.i386.rpm krb5-libs-1.1.1-40.i386.rpm \
  2342.          krb5-configs-1.1.1-40.i386.rpm samba-client-2.0.10-1.62.i386.rpm \
  2343.          samba-2.0.10-1.62.i386.rpm samba-common-2.0.10-1.62.i386.rpm
  2344.   RC1=$?
  2345.  
  2346.   # Check and finish
  2347.   if [ $RC1 = 0 ]
  2348.   then
  2349.     /etc/rc.d/init.d/sendmail restart
  2350.     mv -f /etc/logrotate.d/samba.rpmsave /etc/logrotate.d/samba
  2351.     touch $UPDDIR/2.x-94
  2352.     logger -t "$LOGTAG" "Update 2.x-94 Done."
  2353.   else
  2354.     logger -t "$LOGTAG" "Update 2.x-94 FAILED."
  2355.   fi
  2356. fi
  2357. ###
  2358.  
  2359. ############################################################################
  2360. ### Update 2.x-95 - 08/04/2003
  2361. # SECURITY: samba
  2362. # Obsoletes :
  2363. ############################################################################
  2364.  
  2365. #if [ ! \( -e $UPDDIR/2.x-95 \) ]
  2366. #then
  2367.  
  2368.   # Download the files
  2369. #  cd /tmp
  2370. #  rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/samba-2.2.7-3.6.2.i386.rpm .
  2371. #  rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/samba-common-2.2.7-3.6.2.i386.rpm .
  2372. #  rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/samba-client-2.2.7-3.6.2.i386.rpm .
  2373.  
  2374.   # Do the things...
  2375. #  cp /etc/smb.conf /etc/smb.conf.2.x-95
  2376. #  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
  2377. #  mv -f /etc/smb.conf.2.x-95 /etc/smb.conf
  2378. #  RC1=$?
  2379.  
  2380.   # Check and finish
  2381. #  if [ $RC1 = 0 ]
  2382. #  then
  2383. #    mv /etc/samba/smb.conf /etc/samba/smb.conf.rpm
  2384. #    ln -s /etc/smb.conf /etc/samba/smb.conf
  2385. #    mv -f /etc/logrotate.d/samba /etc/logrotate.d/samba.old
  2386. #    mv -f /etc/logrotate.d/samba.rpmnew /etc/logrotate.d/samba
  2387. #    /etc/rc.d/init.d/smb restart
  2388. #    touch $UPDDIR/2.x-95
  2389. #    logger -t "$LOGTAG" "Update 2.x-95 Done."
  2390. #  else
  2391. #    logger -t "$LOGTAG" "Update 2.x-95 FAILED."
  2392. #  fi
  2393. #fi
  2394. ###
  2395.  
  2396. ############################################################################
  2397. ### Update 2.x-95b - 11/04/2003
  2398. # SECURITY: samba
  2399. # Obsoletes : 2.x-95 (was bugged)
  2400. ############################################################################
  2401.  
  2402. if [ ! \( -e $UPDDIR/2.x-95b \) ]
  2403. then
  2404.  
  2405.   # Download the files
  2406.   cd /tmp
  2407.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/samba-2.2.8a-1.i386.rpm .
  2408.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-95b.tgz .
  2409.  
  2410.   # Do the things...
  2411.   cp /etc/smb.conf /etc/smb.conf.2.x-95b
  2412.   rpm -F samba-2.2.8a-1.i386.rpm
  2413.   RC1=$?
  2414.   tar zxf upd-2.x-95b.tgz --exclude usr/local/ --directory /
  2415.   RC2=$?
  2416.  
  2417.   # Check and finish
  2418.   if [ $RC1 = 0 -a $RC2 = 0 ]
  2419.   then
  2420.     RUNNING=`ps awux |grep smb |grep -v grep`
  2421.     if [ "$RUNNING" != "" ]
  2422.     then
  2423.        /etc/rc.d/init.d/smb stop
  2424.        sleep 5
  2425.        /etc/rc.d/init.d/smb start
  2426.     fi
  2427.     touch $UPDDIR/2.x-95b
  2428.     logger -t "$LOGTAG" "Update 2.x-95b Done."
  2429.   else
  2430.     logger -t "$LOGTAG" "Update 2.x-95b FAILED."
  2431.   fi
  2432. fi
  2433. ###
  2434.  
  2435. ############################################################################
  2436. ### Update 2.x-96 - 11/04/2003
  2437. # SECURITY: samba does not start at boot since 2.x-95
  2438. # Obsoletes :
  2439. ############################################################################
  2440.  
  2441. if [ ! \( -e $UPDDIR/2.x-96 \) ]
  2442. then
  2443.  
  2444.   . /home/hadmin/slis.conf
  2445.   if [ "$SAMBA" = "1" -o "$CYBERECOLE" = "1" -o "CYBERSCHOOL" = 1 ]
  2446.   then
  2447.     /sbin/chkconfig --add smb
  2448.     /sbin/chkconfig smb on
  2449.   fi
  2450.  
  2451.   touch $UPDDIR/2.x-96
  2452.   logger -t "$LOGTAG" "Update 2.x-96 Done."
  2453. fi
  2454. ###
  2455.  
  2456.  
  2457. ############################################################################
  2458. ### Update 2.x-97 - 14/04/2003
  2459. # SECURITY: some smb.conf disapeared!
  2460. # Obsoletes :
  2461. ############################################################################
  2462.  
  2463. if [ ! \( -e $UPDDIR/2.x-97 \) ]
  2464. then
  2465.   cp -f /etc/smb.conf /etc/smb.conf.2.x-97
  2466.   mv -f /etc/samba/smb.conf /etc/samba/smb.conf.orig
  2467.   ln -s /etc/smb.conf /etc/samba/smb.conf
  2468.   /usr/local/sbin/valid
  2469.  
  2470.   touch $UPDDIR/2.x-97
  2471.   logger -t "$LOGTAG" "UPDATE 2.x-97 Done."
  2472. fi
  2473.  
  2474. ############################################################################
  2475. ### Update 2.x-98 - 15/04/2003
  2476. # Bug fix: when deleting and creating again a group, the home into
  2477. # cyberschool directory had not the good perms.
  2478. # Obsoletes:
  2479. ############################################################################
  2480.  
  2481. if [ ! \( -e $UPDDIR/2.x-98 \) ]
  2482. then
  2483.  
  2484.   # Download the files
  2485.   cd /tmp
  2486.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-98.tgz .
  2487.  
  2488.   # Do the things...
  2489.   tar zxf upd-2.x-98.tgz --directory /
  2490.   RC=$?
  2491.  
  2492.   # Check and finish
  2493.   if [ $RC = 0 ]
  2494.   then
  2495.     
  2496.     /usr/local/sbin/valid
  2497.     touch $UPDDIR/2.x-98
  2498.     logger -t "$LOGTAG" "Update 2.x-98 Done."
  2499.   else
  2500.     logger -t "$LOGTAG" "Update 2.x-98 FAILED."
  2501.   fi
  2502. fi
  2503. ###
  2504.  
  2505. ############################################################################
  2506. ### Update 2.x-95c - 15/04/2003
  2507. # SECURITY: samba
  2508. # This is the RH 6.2 update SRPM patched from
  2509. #   http://fi.samba.org/samba/ftp/WHATSNEW-2.2.8a.txt
  2510. # Obsoletes : 2.x-95 (was bugged) and 2.x-95b (samba 2.2.8a was instable on
  2511. #             redhat 6.2)
  2512. ############################################################################
  2513.  
  2514. if [ ! \( -e $UPDDIR/2.x-95c \) ]
  2515. then
  2516.  
  2517.   # Download the files
  2518.   cd /tmp
  2519.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/samba-2.0.10-2.62.i386.rpm .
  2520.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/samba-common-2.0.10-2.62.i386.rpm .
  2521.  
  2522.   # Do the things...
  2523.   cp /etc/smb.conf /etc/smb.conf.2.x-95c
  2524.   rpm --oldpackage -U samba-2.0.10-2.62.i386.rpm samba-common-2.0.10-2.62.i386.rpm
  2525.   RC1=$?
  2526.  
  2527.   # Check and finish
  2528.   if [ $RC1 = 0 ]
  2529.   then
  2530.     RUNNING=`ps awux |grep smb |grep -v grep`
  2531.     if [ "$RUNNING" != "" ]
  2532.     then
  2533.        /etc/rc.d/init.d/smb stop
  2534.        sleep 5
  2535.        /etc/rc.d/init.d/smb start
  2536.     fi
  2537.     /usr/local/sbin/valid
  2538.     touch $UPDDIR/2.x-95c
  2539.     logger -t "$LOGTAG" "Update 2.x-95c Done."
  2540.   else
  2541.     logger -t "$LOGTAG" "Update 2.x-95c FAILED."
  2542.   fi
  2543. fi
  2544. ###
  2545.  
  2546. ############################################################################
  2547. ### Update 2.x-99 - 16/04/2003
  2548. # SECURITY: postgresql
  2549. # Obsoletes : 2.x-87 (never published)
  2550. ############################################################################
  2551.  
  2552. if [ ! \( -e $UPDDIR/2.x-99 \) ]
  2553. then
  2554.  
  2555.   # Download the files
  2556.   cd /tmp
  2557.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/postgresql-server-7.0.3-9.2.62.i386.rpm .
  2558.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/postgresql-7.0.3-9.2.62.i386.rpm .
  2559.  
  2560.   # Do the things...
  2561.   /etc/rc.d/init.d/postgresql stop
  2562.   sleep 10
  2563.   rpm -F --nodeps postgresql-server-7.0.3-9.2.62.i386.rpm postgresql-7.0.3-9.2.62.i386.rpm
  2564.   RC1=$?
  2565.  
  2566.   # Check and finish
  2567.   if [ $RC1 = 0 ]
  2568.   then
  2569.     killall postmaster
  2570.     sleep 1
  2571.     killall -9 postmaster
  2572.     sleep 1
  2573.     rm -f /var/lib/pgsql/data/postmaster.pid
  2574.     /etc/rc.d/init.d/postgresql start    
  2575.  
  2576.     touch $UPDDIR/2.x-99
  2577.     logger -t "$LOGTAG" "Update 2.x-99 Done."
  2578.   else
  2579.     logger -t "$LOGTAG" "Update 2.x-99 FAILED."
  2580.   fi
  2581. fi
  2582. ###
  2583.  
  2584. ############################################################################
  2585. ### Update 2.x-100 - 10/07/2003
  2586. # Smarter slis_update script. It tests the connection to the rsync
  2587. # host before starting the updates.
  2588. # Warning! This update needs TESTFILES.* to be in place, not only upd-2.x-100.tgz!
  2589. # Obsolletes :
  2590. ############################################################################
  2591.  
  2592. if [ ! \( -e $UPDDIR/2.x-100 \) ]
  2593. then
  2594.  
  2595.   # Download the files
  2596.   cd /tmp
  2597.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-100.tgz .
  2598.  
  2599.   # Do the things....
  2600.   tar zxf upd-2.x-100.tgz
  2601.   RC=$?
  2602.  
  2603.   # Check and finish
  2604.   if [ $RC = 0 ]
  2605.   then
  2606.     echo "mv -f /tmp/slis_update_3_1_slisv2.bash /usr/local/sbin/slis_update" | at now + 20 minutes
  2607.     touch $UPDDIR/2.x-100
  2608.     logger -t "$LOGTAG" "Update 2.x-100 Done."
  2609.   else
  2610.     logger -t "$LOGTAG" "Update 2.x-100 FAILED."
  2611.   fi
  2612. fi
  2613. ###
  2614.  
  2615. ############################################################################
  2616. ### Update 2.x-101 - 08/09/2003
  2617. # SECURITY: ftpd
  2618. # Obsoletes :
  2619. ############################################################################
  2620.  
  2621. if [ ! \( -e $UPDDIR/2.x-101 \) ]
  2622. then
  2623.  
  2624.   # Download the files
  2625.   cd /tmp
  2626.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/wu-ftpd-2.6.2-11.73-62.1.i386.rpm .
  2627.  
  2628.   # Do the things...
  2629.   ln -s /lib/libssl.so.0.9.6b /lib/libssl.so.1
  2630.   rpm -F --nodeps wu-ftpd-2.6.2-11.73-62.1.i386.rpm
  2631.   RC1=$?
  2632.  
  2633.   # Check and finish
  2634.   if [ $RC1 = 0 ]
  2635.   then
  2636.     /etc/init.d/inet restart
  2637.  
  2638.     touch $UPDDIR/2.x-101
  2639.     logger -t "$LOGTAG" "Update 2.x-101 Done."
  2640.   else
  2641.     logger -t "$LOGTAG" "Update 2.x-101 FAILED."
  2642.   fi
  2643. fi
  2644. ###
  2645.  
  2646. ############################################################################
  2647. ### Update 2.x-102 - 08/09/2003
  2648. # SECURITY: Disabling swat, telnet (unusefull) and auth
  2649. # Obsoletes :
  2650. ############################################################################
  2651.  
  2652. if [ ! \( -e $UPDDIR/2.x-102 \) ]
  2653. then
  2654.  
  2655.   /bin/cp -f /etc/inetd.conf /etc/inetd.conf.2.x-102
  2656.   /usr/bin/perl -pi -e "s/^swat/#swat/" /etc/inetd.conf
  2657.   /usr/bin/perl -pi -e "s/^telnet/#telnet/" /etc/inetd.conf
  2658.   /etc/rc.d/init.d/inet restart
  2659.   /etc/rc.d/init.d/identd stop
  2660.   /sbin/chkconfig identd off
  2661.  
  2662.   touch $UPDDIR/2.x-102
  2663.   logger -t "$LOGTAG" "Update 2.x-102 Done."
  2664. fi
  2665. ###
  2666.  
  2667.  
  2668. ############################################################################
  2669. ### Update 2.x-104 - 18/09/2003
  2670. # SECURITY: openssh
  2671. # Obsoletes : 2.x-103
  2672. ############################################################################
  2673.  
  2674. if [ ! \( -e $UPDDIR/2.x-104 \) ]
  2675. then
  2676.  
  2677.   # Download the files
  2678.   cd /tmp
  2679.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openssh-3.1p1-13slis2x.i386.rpm .
  2680.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openssh-server-3.1p1-13slis2x.i386.rpm .
  2681.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/openssh-clients-3.1p1-13slis2x.i386.rpm .
  2682.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/sendmail-8.11.6-27.62.i386.rpm .
  2683.  
  2684.   # Do the things...
  2685.   rpm -F --nodeps openssh-3.1p1-13slis2x.i386.rpm \
  2686.          openssh-server-3.1p1-13slis2x.i386.rpm \
  2687.          openssh-clients-3.1p1-13slis2x.i386.rpm \
  2688.          sendmail-8.11.6-27.62.i386.rpm
  2689.   RC1=$?
  2690.  
  2691.   # Check and finish
  2692.   if [ $RC1 = 0 ]
  2693.   then
  2694.     /etc/rc.d/init.d/sshd restart
  2695.     /etc/rc.d/init.d/sendmail stop
  2696.     sleep 5
  2697.     killall -9 sendmail 2> /dev/null
  2698.     sleep 1
  2699.     /etc/rc.d/init.d/sendmail start
  2700.  
  2701.     touch $UPDDIR/2.x-104
  2702.     logger -t "$LOGTAG" "Update 2.x-104 Done."
  2703.   else
  2704.     logger -t "$LOGTAG" "Update 2.x-104 FAILED."
  2705.   fi
  2706. fi
  2707. ###
  2708.  
  2709. ############################################################################
  2710. ### Update 2.x-105b - 18/05/2004
  2711. # SECURITY: firewall is not started at boot since update CP-2
  2712. # Obsoletes : 2.x-105
  2713. ############################################################################
  2714.  
  2715. if [ ! \( -e $UPDDIR/2.x-105b \) ]
  2716. then
  2717.  
  2718.   NEEDED=`grep mkfilters /etc/rc.d/rc.local`
  2719.   if [ "$NEEDED" = "" ]
  2720.   then
  2721.     perl -pi -e "s;Activation du routage avec translation.*;Router and Firewall activation\n  /usr/local/sbin/mkfilters;" /etc/rc.d/rc.local
  2722.     perl -pi -e "s;NAT activation.*;Router and Firewall activation\n  /usr/local/sbin/mkfilters;" /etc/rc.d/rc.local
  2723.    /usr/local/sbin/mkfilters
  2724.   fi
  2725.  
  2726.   touch $UPDDIR/2.x-105b
  2727.   logger -t "$LOGTAG" "Update 2.x-105b Done."
  2728. fi
  2729.  
  2730. ############################################################################
  2731. # Update 2.x-106 - 06/05/2004
  2732. # SECURITY: Fixes a vulnerability of the web server configuration: one could
  2733. # do a privilege escalation by using SSI and a mistake in the permission of
  2734. # the httpd.conf file. Thanx to Jean Diraison, from Versailles!
  2735. # Obsoletes :
  2736. ############################################################################
  2737.  
  2738. if [ ! \( -e $UPDDIR/2.x-106 \) ]
  2739. then
  2740.      # Download the files
  2741.      cd /tmp
  2742.      rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-106.tgz .
  2743.  
  2744.      # Do the things ...
  2745.      tar xfz upd-2.x-106.tgz --exclude usr/local/ --directory /
  2746.      RC=$?
  2747.      bash /usr/local/sbin/permslis
  2748.      perl -pi -e "s/AddHandler server-parsed/#AddHandler server-parsed/" /etc/httpd/conf/httpd.conf
  2749.      killall -HUP httpd
  2750.  
  2751.      # Check and finish
  2752.      if [ $RC = 0 ]
  2753.      then
  2754.          touch $UPDDIR/2.x-106
  2755.          logger -t "$LOGTAG" "Update 2.x-106 Done."
  2756.      else
  2757.          logger -t "$LOGTAG" "Update 2.x-106 FAILED."
  2758.      fi
  2759. fi
  2760. ###
  2761.  
  2762. ############################################################################
  2763. # Update 2.x-107 - 11/05/2004
  2764. # BUG FIX: 2.x-106 side effect: administrator could not change passwd anymore
  2765. # SECURITY: The admin could pass arbitrary commands to root by using well
  2766. # constructed urls sent to the services.php script. (Thanx to Jean Diraison)
  2767. # Obsoletes :
  2768. ############################################################################
  2769.  
  2770. if [ ! \( -e $UPDDIR/2.x-107 \) ]
  2771. then
  2772.      # Download the files
  2773.      cd /tmp
  2774.      rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-107.tgz .
  2775.  
  2776.      # Do the things ...
  2777.      tar xfz upd-2.x-107.tgz --exclude usr/local/ --directory /
  2778.      RC=$?
  2779.      bash /usr/local/sbin/permslis
  2780.  
  2781.      # Check and finish
  2782.      if [ $RC = 0 ]
  2783.      then
  2784.          touch $UPDDIR/2.x-107
  2785.          logger -t "$LOGTAG" "Update 2.x-107 Done."
  2786.      else
  2787.          logger -t "$LOGTAG" "Update 2.x-107 FAILED."
  2788.      fi
  2789. fi
  2790. ###
  2791.  
  2792. ############################################################################
  2793. # Update 2.x-108 - 23/06/2004
  2794. # Bug fix: precompiled adult database was not loaded by squidguard
  2795. # (new mksquidguardconf script)
  2796. # Obsoletes :
  2797. ############################################################################
  2798.  
  2799. if [ ! \( -e $UPDDIR/2.x-108 \) ]
  2800. then
  2801.      # Download the files
  2802.      cd /tmp
  2803.      rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/upd-2.x-108.tgz .
  2804.  
  2805.      # Do the things ...
  2806.      tar xfz upd-2.x-108.tgz --exclude usr/local/ --directory /
  2807.      RC=$?
  2808.      bash /usr/local/sbin/permslis
  2809.      /usr/local/sbin/mksquidguardconf
  2810.      killall -HUP squid
  2811.  
  2812.      # Check and finish
  2813.      if [ $RC = 0 ]
  2814.      then
  2815.          touch $UPDDIR/2.x-108
  2816.          logger -t "$LOGTAG" "Update 2.x-108 Done."
  2817.      else
  2818.          logger -t "$LOGTAG" "Update 2.x-108 FAILED."
  2819.      fi
  2820. fi
  2821. ###
  2822.  
  2823.  
  2824. ############################################################################
  2825. ### Mise a jour PQ - 05/04/2000
  2826. # Nouveau script /usr/local/sbin/process_queue
  2827. # Rend obsolete : 004-0 a 004-7 et PQ-1 PQ-2 PQ-3 PQ-4 PQ-5 PQ-6 PQ-7 ...
  2828. # Si un nouveau process_queue est rΘalisΘ, juste remplacer le numero de
  2829. # version et le fichier.
  2830. # ATTENTION: Laisser cette UPD en fin de fichier, avant les UPD KERNEL.
  2831. ############################################################################
  2832. VERSION=15
  2833. DELAI=5 # Delai en minutes. C'est le temps estime que prendra l'execution de
  2834.         # la fin de ce script plus une marge (install d'un nouveau slis)...
  2835.  
  2836. if [ ! \( -e $UPDDIR/PQ-$VERSION \) ]
  2837. then
  2838.   PAS_UPD_KERNEL=1 # Empeche de faire une update du noyau
  2839.  
  2840.   # Telechargement du nouveau fichier
  2841.   cd /tmp
  2842.   rsync rsync://$RSYNC_HOST/$RSYNC_MODULE/process_queue-2.x .
  2843.   mv -f process_queue-2.x process_queue
  2844.   # Si slis_update est lance par process_queue, il faut faire attention
  2845.   # a ne pas le remplacer tout de suite:
  2846.   PS=`ps auwx | grep process_queue|grep -v grep`
  2847.   if [ "$PS" != "" ]
  2848.   then
  2849.     echo "mv -f /tmp/process_queue /usr/local/sbin/ ; chmod 700 /usr/local/sbin/process_queue" | at now + $DELAI minutes
  2850.   else
  2851.     mv -f /tmp/process_queue /usr/local/sbin/ ; chmod 700 /usr/local/sbin/process_queue
  2852.   fi
  2853.   touch $UPDDIR/PQ-$VERSION
  2854.   logger -t "$LOGTAG" "UPDATE PQ-$VERSION effectuee."
  2855. fi
  2856. ###
  2857.  
  2858. ############################################################################
  2859. ### NOTIFY update - 29/04/99
  2860. # Notify installation of a new SLIS
  2861. # Obsoletes :
  2862. ############################################################################
  2863.  
  2864. if [ ! \( -e $UPDDIR/NOTIFY-2.1 \) ]
  2865. then
  2866.   echo "$HOSTNAME installed" | mail -s "New SLIS 2.1" $SLISMASTER
  2867.   sleep 2
  2868.   /usr/lib/sendmail -q
  2869.   killall crond
  2870.   sleep 1
  2871.   crond
  2872.  
  2873.   touch $UPDDIR/NOTIFY-2.1
  2874.   logger -t "$LOGTAG" "NOTIFY sent."
  2875. fi
  2876. ###
  2877.  
  2878. ##############################
  2879. logger -t "$LOGTAG" "Script Version 2.1 ended."
  2880.  
  2881. /bin/rm -rf /var/lock/slis_upd
  2882.  
  2883.