Subversion Repositories ALCASAR

Rev

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

Rev 1247 Rev 1249
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 1247 2013-10-15 16:33:13Z crox53 $ 
2
#  $Id: alcasar.sh 1249 2013-10-22 22:09:01Z richard $ 
3
 
3
 
4
# alcasar.sh
4
# alcasar.sh
5
 
5
 
6
# ALCASAR Install script -  CopyLeft ALCASAR Team [Rexy + 3abtux + Steweb + Crox + ...] 
6
# ALCASAR Install script -  CopyLeft ALCASAR Team [Rexy + 3abtux + Steweb + Crox + ...] 
7
# Ce programme est un logiciel libre ; This software is free and open source
7
# Ce programme est un logiciel libre ; This software is free and open source
Line 598... Line 598...
598
		until [ -s $DIR_DEST_ETC/digest/key_admin ]
598
		until [ -s $DIR_DEST_ETC/digest/key_admin ]
599
			do
599
			do
600
				/usr/sbin/htdigest -c $DIR_DEST_ETC/digest/key_admin $HOSTNAME.$DOMAIN $admin_portal
600
				/usr/sbin/htdigest -c $DIR_DEST_ETC/digest/key_admin $HOSTNAME.$DOMAIN $admin_portal
601
			done
601
			done
602
		$DIR_DEST_SBIN/alcasar-profil.sh --list
602
		$DIR_DEST_SBIN/alcasar-profil.sh --list
603
	else   # mise à jour des versions < 2.1
603
	else   # mise à jour des versions < 2.8
604
		if [ $MAJ_PREVIOUS_VERSION -lt 2 ] || ([ $MAJ_PREVIOUS_VERSION -eq 2 ] && [ $MIN_PREVIOUS_VERSION -lt 1 ])
604
		if [ $MAJ_PREVIOUS_VERSION -lt 2 ] || ([ $MAJ_PREVIOUS_VERSION -eq 2 ] && [ $MIN_PREVIOUS_VERSION -lt 8 ])
605
			then
605
			then
606
			if [ $Lang == "fr" ]
606
			if [ $Lang == "fr" ]
607
			then 
607
			then 
608
				echo "Cette mise à jour nécessite de redéfinir le premier compte d'administration du portail"
608
				echo "Cette mise à jour nécessite de redéfinir le premier compte d'administration du portail"
609
				echo
609
				echo
Line 975... Line 975...
975
dhcpif		$INTIF
975
dhcpif		$INTIF
976
ethers		$DIR_DEST_ETC/alcasar-ethers
976
ethers		$DIR_DEST_ETC/alcasar-ethers
977
#nodynip
977
#nodynip
978
#statip
978
#statip
979
dynip		$PRIVATE_NETWORK_MASK
979
dynip		$PRIVATE_NETWORK_MASK
980
domain		localdomain
980
domain		$DOMAIN
981
dns1		$PRIVATE_IP
981
dns1		$PRIVATE_IP
982
dns2		$PRIVATE_IP
982
dns2		$PRIVATE_IP
983
uamlisten	$PRIVATE_IP
983
uamlisten	$PRIVATE_IP
984
uamport		3990
984
uamport		3990
985
macauth
985
macauth
Line 991... Line 991...
991
radiusauthport	1812
991
radiusauthport	1812
992
radiusacctport	1813
992
radiusacctport	1813
993
uamserver	https://$HOSTNAME.$DOMAIN/intercept.php
993
uamserver	https://$HOSTNAME.$DOMAIN/intercept.php
994
radiusnasid	$HOSTNAME.$DOMAIN
994
radiusnasid	$HOSTNAME.$DOMAIN
995
uamsecret	$secretuam
995
uamsecret	$secretuam
996
uamallowed	alcasar
996
uamallowed	$HOSTNAME,$HOSTNAME.$DOMAIN
997
coaport		3799
997
coaport		3799
998
include		$DIR_DEST_ETC/alcasar-uamallowed
998
include		$DIR_DEST_ETC/alcasar-uamallowed
999
include		$DIR_DEST_ETC/alcasar-uamdomain
999
include		$DIR_DEST_ETC/alcasar-uamdomain
1000
#dhcpgateway		
1000
#dhcpgateway		
1001
#dhcprelayagent
1001
#dhcprelayagent
Line 1742... Line 1742...
1742
		;;
1742
		;;
1743
	-i | --install)
1743
	-i | --install)
1744
		license
1744
		license
1745
		header_install
1745
		header_install
1746
		testing
1746
		testing
1747
# Test if ALCASAR is already installed
1747
# Test if ALCASAR is already installed (before v2.2, the conf file doesn't exist --> can't update)
1748
		if [ -e $DIR_WEB/VERSION ]
1748
		if [ -e $CONF_FILE ]
1749
		then
1749
		then
1750
			actual_version=`cat $DIR_WEB/VERSION`
1750
			current_version=`cat $CONF_FILE | grep VERSION | cut -d"=" -f2`
1751
			if [ $Lang == "fr" ]
1751
			if [ $Lang == "fr" ]
1752
				then echo -n "La version "; echo -n $actual_version ; echo " d'ALCASAR est déjà installée";
1752
				then echo -n "La version "; echo -n $current_version ; echo " d'ALCASAR est déjà installée";
1753
				else echo -n "ALCASAR Version "; echo -n $actual_version ; echo " is already installed";
1753
				else echo -n "ALCASAR Version "; echo -n $current_version ; echo " is already installed";
1754
			fi
1754
			fi
1755
			response=0
1755
			response=0
1756
			PTN='^[oOnNyY]$'
1756
			PTN='^[oOnNyY]$'
1757
			until [[ $(expr $response : $PTN) -gt 0 ]]
1757
			until [[ $(expr $response : $PTN) -gt 0 ]]
1758
			do
1758
			do
Line 1771... Line 1771...
1771
				mode="update"
1771
				mode="update"
1772
			fi
1772
			fi
1773
		fi
1773
		fi
1774
# RPMs install
1774
# RPMs install
1775
		$DIR_SCRIPTS/alcasar-urpmi.sh
1775
		$DIR_SCRIPTS/alcasar-urpmi.sh
1776
		echo "Mise à jour des modules noyau installés"		
-
 
1777
		if [ "$?" != "0" ]
1776
		if [ "$?" != "0" ]
1778
		then
1777
		then
1779
			exit 0
1778
			exit 0
1780
		fi
1779
		fi
1781
		if [ -e $DIR_WEB/VERSION ]
1780
		if [ -e $CONF_FILE ]
1782
		then
1781
		then
1783
# Uninstall the running version
1782
# Uninstall the running version
1784
			$DIR_SCRIPTS/sbin/alcasar-uninstall.sh
1783
			$DIR_SCRIPTS/sbin/alcasar-uninstall.sh
1785
		fi
1784
		fi
1786
# Test if manual update	
1785
# Test if manual update