Subversion Repositories ALCASAR

Rev

Rev 1052 | Rev 1060 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 1052 Rev 1057
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 1052 2013-03-24 21:00:10Z richard $ 
2
#  $Id: alcasar.sh 1057 2013-03-27 22:05:36Z richard $ 
3
 
3
 
4
# alcasar.sh
4
# alcasar.sh
5
 
5
 
6
# ALCASAR - Portail captif d'accès à l'Internet -  Copyright (C) [2005] [ALcasar team - Rexy - 3abtux - ...] 
6
# ALCASAR - Portail captif d'accès à l'Internet -  Copyright (C) [2005] [ALcasar team - Rexy - 3abtux - ...] 
7
# Ce programme est un logiciel libre ; vous pouvez le redistribuer et/ou le modifier au titre des clauses de la Licence Publique Générale GNU, 
7
# Ce programme est un logiciel libre ; vous pouvez le redistribuer et/ou le modifier au titre des clauses de la Licence Publique Générale GNU, 
Line 1748... Line 1748...
1748
		then
1748
		then
1749
# Uninstall the running version
1749
# Uninstall the running version
1750
			$DIR_SCRIPTS/sbin/alcasar-uninstall.sh
1750
			$DIR_SCRIPTS/sbin/alcasar-uninstall.sh
1751
		fi
1751
		fi
1752
# Test if manual update	
1752
# Test if manual update	
1753
		if [ -e /tmp/alcasar-conf.tar.gz ] && [ "$mode" != "update" ]
1753
		if [ -e /tmp/alcasar-conf*.tar.gz ] && [ "$mode" != "update" ]
1754
		then
1754
		then
1755
			header_install
1755
			header_install
1756
			if [ $Lang == "fr" ]
1756
			if [ $Lang == "fr" ]
1757
				then echo "Le fichier de configuration d'une ancienne version a été trouvé";
1757
				then echo "Le fichier de configuration d'une ancienne version a été trouvé";
1758
				else echo "The configuration file of an old version has been found";
1758
				else echo "The configuration file of an old version has been found";
Line 1770... Line 1770...
1770
				then rm -f /tmp/alcasar-conf*
1770
				then rm -f /tmp/alcasar-conf*
1771
				fi
1771
				fi
1772
			done
1772
			done
1773
		fi
1773
		fi
1774
# Test if update
1774
# Test if update
1775
		if [ -e /tmp/alcasar-conf.tar.gz ] 
1775
		if [ -e /tmp/alcasar-conf* ] 
1776
		then
1776
		then
1777
			if [ $Lang == "fr" ]
1777
			if [ $Lang == "fr" ]
1778
				then echo "#### Installation avec mise à jour ####";
1778
				then echo "#### Installation avec mise à jour ####";
1779
				else echo "#### Installation with update     ####";
1779
				else echo "#### Installation with update     ####";
1780
			fi
1780
			fi
1781
# Extract the central configuration file
1781
# Extract the central configuration file
1782
			tar -xf /tmp/alcasar-conf.tar.gz conf/etc/alcasar.conf 
1782
			tar -xf /tmp/alcasar-conf* conf/etc/alcasar.conf 
1783
			ORGANISME=`grep ORGANISM conf/etc/alcasar.conf|cut -d"=" -f2`
1783
			ORGANISME=`grep ORGANISM conf/etc/alcasar.conf|cut -d"=" -f2`
1784
			PREVIOUS_VERSION=`grep VERSION conf/etc/alcasar.conf|cut -d"=" -f2`
1784
			PREVIOUS_VERSION=`grep VERSION conf/etc/alcasar.conf|cut -d"=" -f2`
1785
			MAJ_PREVIOUS_VERSION=`echo $PREVIOUS_VERSION|cut -d"." -f1`
1785
			MAJ_PREVIOUS_VERSION=`echo $PREVIOUS_VERSION|cut -d"." -f1`
1786
			MIN_PREVIOUS_VERSION=`echo $PREVIOUS_VERSION|cut -d"." -f2|cut -c1`
1786
			MIN_PREVIOUS_VERSION=`echo $PREVIOUS_VERSION|cut -d"." -f2|cut -c1`
1787
			UPD_PREVIOUS_VERSION=`echo $PREVIOUS_VERSION|cut -d"." -f3`
1787
			UPD_PREVIOUS_VERSION=`echo $PREVIOUS_VERSION|cut -d"." -f3`