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-academie-3.2
< prev
next >
Wrap
Text File
|
2012-12-03
|
3KB
|
115 lines
#!/bin/bash
# slis_update-academie
# CUSTOMIZABLE UPDATE SCRIPT
# 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-2000 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>
#
### VARIABLES ###
UPDDIR=/home/hadmin/updates
LOGTAG="slis_update[$$]"
grep HOSTNAME /etc/sysconfig/network > /tmp/hostname
. /tmp/hostname
rm -rf /tmp/hostname
WEBMASTER=`ls -ld /home/httpd/html |awk '{print $3}'`
. /home/hadmin/slis.conf 2>/dev/null
. /usr/local/lib/slis-sys.inc.bash
load_config
# PUT HERE THE VARIABLES YOU NEED
##################
# Locking
if [ -e /var/lock/slis_upd ]
then
logger -t "$LOGTAG" "Lock found. Update already started."
exit
fi
touch /var/lock/slis_upd
sleep 1
logger -t "$LOGTAG" "Script Academy 3.2 started."
##################
# PUT HERE YOUR PERSONNAL UPDATES
# Change update server
if [ ! \( -e $UPDDIR/update_server \) ]
then
sed -i "s/RSYNC_HOST=[\"']193.54.149.12[\"']/RSYNC_HOST=\"193.54.149.22\"/" /etc/slis/slis.conf
if [ $? != 0 ]
then
logger -t "$LOGTAG" "Changing update server - ERROR: sed failed!"
FAILURE=1
else
sed -i 's;ftp://ftp.ac-grenoble.fr/pub/slis;ftp://old.slis.fr/;' /etc/apt/sources.list
if [ $? != 0 ]
then
logger -t "$LOGTAG" "Changing update server - ERROR: sed failed!"
FAILURE=1
else
touch $UPDDIR/update_server
fi
fi
fi
######################
##############################
logger -t "$LOGTAG" "Script Academy 3.2 ended."
/bin/rm -rf /var/lock/slis_upd