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-common-pre < prev    next >
Text File  |  2006-02-15  |  2KB  |  72 lines

  1. #!/bin/bash
  2.  
  3. # slis_update-common-pre
  4. # Common updates, started before version updates
  5.  
  6.  
  7. ### VARIABLES ###
  8. UPDDIR=/home/hadmin/updates
  9. LOGTAG="slis_update[$$]"
  10. grep HOSTNAME /etc/sysconfig/network > /tmp/hostname
  11. . /tmp/hostname
  12. rm -rf /tmp/hostname
  13. WEBMASTER=`ls -ld /home/httpd/html |awk '{print $3}'`
  14. . /home/hadmin/slis.conf 2>/dev/null
  15. . /usr/local/lib/slis-sys.inc.bash 2>/dev/null
  16. load_config 2>/dev/null
  17.  
  18.  
  19. ##################
  20.  
  21. # Locking
  22. if [ -e /var/lock/slis_upd ]
  23. then
  24.   logger -t "$LOGTAG" "Lock found. Update already started."
  25.   exit
  26. fi
  27. touch /var/lock/slis_upd
  28. sleep 1
  29.  
  30. logger -t "$LOGTAG" "Script Common-Pre started."
  31. ##############################
  32.  
  33.  
  34. ############################################################################
  35. ### Update SONDAGE1 - 14/02/2006
  36. # Register the SLIS to http://www.slis.fr/sondage/register.php
  37. # just to count the total number of installed SLIS
  38. # This registering is only opened for this month. It will be disabled
  39. # as soon as the total number is stabilized. Then, we'll be able to publish
  40. # "As February 2006, there'are *N* SLIS up2date worldwild!" 
  41. ############################################################################
  42.  
  43. if [ ! \( -e $UPDDIR/SONDAGE1 \) ]
  44. then
  45.  
  46.   HOST=`hostname -s`
  47.   DOMAIN=`hostname -d`
  48.   VERSION=`cat /etc/version_slis_num`
  49.   wget -t 1 -T 20 -q -O /tmp/sondage "http://www.slis.fr/sondage/register.php?action=register&host=$HOST&domain=$DOMAIN&version=$VERSION"
  50.   RC=$?
  51.  
  52.   if [ $RC = 0 ]
  53.   then
  54.     if [ "`egrep "Bad|ERROR" /tmp/sondage`" != "" ]
  55.     then
  56.        wget -q -O /dev/null "http://www.slis.fr/sondage/register.php?action=error"
  57.     fi
  58.     touch $UPDDIR/SONDAGE1
  59.     logger -t "$LOGTAG" "Update SONDAGE1 done."
  60.   fi
  61. fi
  62. ###
  63.  
  64.  
  65.  
  66.  
  67. ##############################
  68. logger -t "$LOGTAG" "Script Common-Pre ended."
  69.  
  70. /bin/rm -rf /var/lock/slis_upd
  71.  
  72.