Subversion Repositories ALCASAR

Rev

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

Rev 1008 Rev 1010
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 1008 2013-01-05 23:13:33Z richard $ 
2
#  $Id: alcasar.sh 1010 2013-01-06 14:06:16Z 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 592... Line 592...
592
			do
592
			do
593
				/usr/sbin/htdigest -c $DIR_DEST_ETC/digest/key_admin $HOSTNAME $admin_portal
593
				/usr/sbin/htdigest -c $DIR_DEST_ETC/digest/key_admin $HOSTNAME $admin_portal
594
			done
594
			done
595
		$DIR_DEST_SBIN/alcasar-profil.sh --list
595
		$DIR_DEST_SBIN/alcasar-profil.sh --list
596
	else   # mise à jour des versions < 2.1
596
	else   # mise à jour des versions < 2.1
597
		if [ $MAJ_RUNNING_VERSION -lt 2 ] || ([ $MAJ_RUNNING_VERSION -eq 2 ] && [ $MIN_RUNNING_VERSION -lt 1 ])
597
		if [ $MAJ_PREVIOUS_VERSION -lt 2 ] || ([ $MAJ_PREVIOUS_VERSION -eq 2 ] && [ $MIN_PREVIOUS_VERSION -lt 1 ])
598
			then
598
			then
599
			if [ $Lang == "fr" ]
599
			if [ $Lang == "fr" ]
600
			then 
600
			then 
601
				echo "Cette mise à jour nécessite de redéfinir le premier compte d'administration du portail"
601
				echo "Cette mise à jour nécessite de redéfinir le premier compte d'administration du portail"
602
				echo
602
				echo
Line 1745... Line 1745...
1745
		then
1745
		then
1746
			exit 0
1746
			exit 0
1747
		fi
1747
		fi
1748
		if [ -e $DIR_WEB/VERSION ]
1748
		if [ -e $DIR_WEB/VERSION ]
1749
		then
1749
		then
1750
			RUNNING_VERSION=`cat $DIR_WEB/VERSION|cut -d" " -f1`
-
 
1751
			MAJ_RUNNING_VERSION=`echo $RUNNING_VERSION|cut -d"." -f1`
-
 
1752
			MIN_RUNNING_VERSION=`echo $RUNNING_VERSION|cut -d"." -f2|cut -c1`
-
 
1753
			UPD_RUNNING_VERSION=`echo $RUNNING_VERSION|cut -d"." -f3`
-
 
1754
# Uninstall the running version
1750
# Uninstall the running version
1755
			$DIR_SCRIPTS/sbin/alcasar-uninstall.sh
1751
			$DIR_SCRIPTS/sbin/alcasar-uninstall.sh
1756
		fi
1752
		fi
1757
# Test if manual update	
1753
# Test if manual update	
1758
		if [ -e /tmp/alcasar-conf.tar.gz ] && [ "$mode" != "update" ]
1754
		if [ -e /tmp/alcasar-conf.tar.gz ] && [ "$mode" != "update" ]
Line 1784... Line 1780...
1784
				else echo "#### Installation with update     ####";
1780
				else echo "#### Installation with update     ####";
1785
			fi
1781
			fi
1786
# Extract the central configuration file
1782
# Extract the central configuration file
1787
			tar -xf /tmp/alcasar-conf.tar.gz conf/etc/alcasar.conf 
1783
			tar -xf /tmp/alcasar-conf.tar.gz conf/etc/alcasar.conf 
1788
			ORGANISME=`grep ORGANISM conf/etc/alcasar.conf|cut -d"=" -f2`
1784
			ORGANISME=`grep ORGANISM conf/etc/alcasar.conf|cut -d"=" -f2`
-
 
1785
			PREVIOUS_VERSION=`grep VERSION conf/etc/alcasar.conf|cut -d"=" -f2`
-
 
1786
			MAJ_PREVIOUS_VERSION=`echo $PREVIOUS_VERSION|cut -d"." -f1`
-
 
1787
			MIN_PREVIOUS_VERSION=`echo $PREVIOUS_VERSION|cut -d"." -f2|cut -c1`
-
 
1788
			UPD_PREVIOUS_VERSION=`echo $PREVIOUS_VERSION|cut -d"." -f3`
1789
			mode="update"
1789
			mode="update"
1790
		else
1790
		else
1791
			mode="install"
1791
			mode="install"
1792
		fi
1792
		fi
1793
		for func in init network gestion AC init_db param_radius param_web_radius param_chilli param_squid param_dansguardian antivirus param_ulogd param_awstats param_dnsmasq BL cron post_install
1793
		for func in init network gestion AC init_db param_radius param_web_radius param_chilli param_squid param_dansguardian antivirus param_ulogd param_awstats param_dnsmasq BL cron post_install