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.1_rsync
/
lcslis_dom0_update-academie-4.1
< prev
next >
Wrap
Text File
|
2009-05-03
|
2KB
|
76 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
#
# Comments:
# Downloaded via rsync and executed by SLIS during
# the 'slis_update' process
# Started after the slis_update-common-post script
#
# VARIABLES
#
LOGTAG="lcslis_dom0_update-academie-4.1[$$]"
LOCKFILE="/var/lock/lcslis_dom0_update-academie-4.1"
SCRIPT_STATUS_MSG="Script 'lcslis_dom0_update-academie'"
UPDIR="/etc/lcslis-dom0/updates"
write_to_log()
{
/usr/bin/logger -t "$LOGTAG" $*
}
send_to_slismaster()
{
echo "$*" | mail "$SLISMASTER" -s "`hostname` : Update: $LOGTAG"
}
exit_this_update()
{
write_to_log $*
send_to_slismaster $*
write_to_log "$SCRIPT_STATUS_MSG: failed."
exit 1
}
#
# Locking
#
if [ -e $LOCKFILE ]; then
# Then if the lock is older than 10 days, remove the lockfile and lock again.
LOCKFILE_OLD=`find $LOCKFILE -nowarn -ctime +10 -print`
if [ "$LOCKFILE_OLD" != "" ]; then
write_to_log "Info: Very old lock found (more than 10 days), removing it."
rm -f $LOCKFILE
else
write_to_log "Lock found. Update already started."
exit
fi
fi
/bin/touch $LOCKFILE
[ -d $UPDIR ] || /bin/mkdir -p $UPDIR
write_to_log "$SCRIPT_STATUS_MSG: started."
################################################################################
#
# Put your update here !
#
################################################################################
write_to_log "$SCRIPT_STATUS_MSG: successed."
/bin/rm -f $LOCKFILE