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_4.0_rsync
/
slis_update-common-pre
< prev
next >
Wrap
Text File
|
2007-06-05
|
3KB
|
104 lines
#!/bin/bash
# This script is part of the SLIS Project initiated by the CARMI-Internet
# (AcadΘmie de Grenoble - France 38).
# Ce script fait partie du projet SLIS dΘmarrΘ par le CARMI-Internet
# (AcadΘmie de Grenoble - France 38).
#
# SLIS : Serveur de communications Linux pour l'Internet Scolaire.
# Copyright (C) 1998-2003 Bruno Bzeznik
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program (For example ./COPYING);
# if not, write to the Free Software Foundation, Inc., 675 Mass Ave,
# Cambridge, MA 02139, USA.
#
# Please send all comments and bug reports by electronic mail to:
# Bruno Bzeznik <Bruno@ac-grenoble.fr>
# or to <slis@ac-grenoble.fr>
#
# Envoyez vos suggestions et reports de bugs par e-mail α
# Bruno Bzeznik <Bruno@ac-grenoble.fr>
# ou α <slis@ac-grenoble.fr>
#
# Contact: Olivier.LeCam@crdp.ac-versailles.fr
#
# Comments:
# Downloaded via rsync and executed by SLIS during
# the 'slis_update' process
# Started before version updates
#
# Updates:
# olecam: Jan 9, 2006: script ported to SLIS v4
#
# Variables
#
LOGTAG="slis_update-common-pre[$$]"
VERSION=`cat /etc/version_slis_num`
SLIS_LIB="/usr/sbin/slis-sys.inc.bash"
LOCKFILE="/var/lock/slis/slis_update-common-pre"
SCRIPT_STATUS_MSG="Script 'slis_update-common-pre'"
. $SLIS_LIB 2>/dev/null
load_config 2>/dev/null
#
# Locking
#
if [ -e $LOCKFILE ]
then
logger -t "$LOGTAG" "Lock found. Update already started."
exit
fi
touch $LOCKFILE
sleep 1
logger -t "$LOGTAG" "$SCRIPT_STATUS_MSG: started."
##############################
############################################################################
### Update SONDAGE1 - 14/02/2006
# Register the SLIS to http://www.slis.fr/sondage/register.php
# just to count the total number of installed SLIS
# This registering is only opened for this month. It will be disabled
# as soon as the total number is stabilized. Then, we'll be able to publish
# "As February 2006, there'are *N* SLIS up2date worldwild!"
############################################################################
UPDDIR="/tmp"
if [ ! \( -e $UPDDIR/SONDAGE1 \) ]
then
HOST=`hostname -s`
DOMAIN=`hostname -d`
VERSION=`cat /etc/version_slis_num`
wget -t 1 -T 20 -q -O /tmp/sondage "http://www.slis.fr/sondage/register.php?action=register&host=$HOST&domain=$DOMAIN&version=$VERSION"
RC=$?
if [ $RC = 0 ]
then
if [ "`egrep "Bad|ERROR" /tmp/sondage`" != "" ]
then
wget -q -O /dev/null "http://www.slis.fr/sondage/register.php?action=error"
fi
touch $UPDDIR/SONDAGE1
logger -t "$LOGTAG" "Update SONDAGE1 done."
fi
fi
###
##############################
logger -t "$LOGTAG" "$SCRIPT_STATUS_MSG: successed."
rm -f $LOCKFILE