Subversion Repositories ALCASAR

Rev

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

Rev 612 Rev 613
Line 1... Line 1...
1
#!/bin/sh
1
#!/bin/sh
2
#  $Id: alcasar.sh 612 2011-05-22 21:19:27Z richard $ 
2
#  $Id: alcasar.sh 613 2011-05-23 22:02:37Z richard $ 
3
 
3
 
4
# alcasar.sh
4
# alcasar.sh
5
# by Franck BOUIJOUX, Pascal LEVANT and Richard REY
5
# by Franck BOUIJOUX, Pascal LEVANT and Richard REY
6
# This script is distributed under the Gnu General Public License (GPL)
6
# This script is distributed under the Gnu General Public License (GPL)
7
 
7
 
Line 201... Line 201...
201
			if [ $Lang == "fr" ]
201
			if [ $Lang == "fr" ]
202
			       	then echo -n "Entrez le nom de votre organisme : "
202
			       	then echo -n "Entrez le nom de votre organisme : "
203
				else echo -n "Enter the name of your organism : "
203
				else echo -n "Enter the name of your organism : "
204
			fi
204
			fi
205
			read ORGANISME
205
			read ORGANISME
206
			if [ "$ORGANISME" = "" ]
206
			if [ "$ORGANISME" == "" ]
207
				then
207
				then
208
				ORGANISME=!
208
				ORGANISME=!
209
			fi
209
			fi
210
		done
210
		done
211
	fi
211
	fi
Line 497... Line 497...
497
	echo "- ALCASAR Control Center URL : http://$HOSTNAME" >> $FIC_PARAM
497
	echo "- ALCASAR Control Center URL : http://$HOSTNAME" >> $FIC_PARAM
498
# Définition du premier compte lié au profil 'admin'
498
# Définition du premier compte lié au profil 'admin'
499
	header_install
499
	header_install
500
	if [ "$mode" = "install" ]
500
	if [ "$mode" = "install" ]
501
	then
501
	then
-
 
502
		admin_portal=!
-
 
503
		PTN='^[a-zA-Z0-9-]*$'
-
 
504
		until [[ $(expr $admin_portal : $PTN) -gt 0 ]]
-
 
505
                	do
502
		header_install
506
			header_install
503
		if [ $Lang == "fr" ]
507
			if [ $Lang == "fr" ]
504
		then 
508
			then 
505
			echo "Pour administrer Alcasar via le centre de gestion WEB, trois profils de comptes ont été définis :"
-
 
506
			echo " - le profil 'admin' capable de réaliser toutes les opérations"
-
 
507
			echo " - le profil 'backup' lié uniquement aux fonctions d'archivage"
-
 
508
			echo " - le profil 'manager' lié uniquement aux fonctions de gestion des usagers"
-
 
509
			echo ""
509
				echo ""
510
			echo "Définissez le premier compte du profil 'admin' :"
510
				echo "Définissez un premier compte d'administration du portail :"
511
			echo
511
				echo
512
			echo -n "Nom : "
512
				echo -n "Nom : "
513
		else
513
			else
514
			echo "To manage Alcasar thru the WEB control center, three accounts profiles were defined :"
-
 
515
			echo " - the 'admin profile who can do all operations"
-
 
516
			echo " - the 'backup' profile link to backup functions"
-
 
517
			echo " - the 'manager' profile link to users management"
-
 
518
			echo ""
514
				echo ""
519
			echo "Define the first account of the 'admin' profile :"
515
				echo "Define the first account allow to administrate the portal :"
520
			echo
516
				echo
521
			echo -n "Account : "
517
				echo -n "Account : "
522
		fi
518
			fi
523
		read admin_portail
519
			read admin_portal
-
 
520
			if [ "$admin_portal" == "" ]
-
 
521
				then
-
 
522
				admin_portal=!
-
 
523
			fi
-
 
524
			done
524
		echo "- Name of the first account of the admin profile : $admin_portail" >> $FIC_PARAM
525
		echo "- Name of the first account of the admin profile : $admin_portal" >> $FIC_PARAM
525
# Création du fichier de clés de ce compte dans le profil "admin"
526
# Création du fichier de clés de ce compte dans le profil "admin"
526
		[ -d $DIR_DEST_ETC/digest ] && rm -rf $DIR_DEST_ETC/digest
527
		[ -d $DIR_DEST_ETC/digest ] && rm -rf $DIR_DEST_ETC/digest
527
		mkdir -p $DIR_DEST_ETC/digest
528
		mkdir -p $DIR_DEST_ETC/digest
528
		chmod 755 $DIR_DEST_ETC/digest
529
		chmod 755 $DIR_DEST_ETC/digest
529
		until [ -s $DIR_DEST_ETC/digest/key_admin ]
530
		until [ -s $DIR_DEST_ETC/digest/key_admin ]
530
			do
531
			do
531
				/usr/sbin/htdigest -c $DIR_DEST_ETC/digest/key_admin $HOSTNAME $admin_portail
532
				/usr/sbin/htdigest -c $DIR_DEST_ETC/digest/key_admin $HOSTNAME $admin_portal
532
			done
533
			done
533
		$DIR_DEST_SBIN/alcasar-profil.sh --list
534
		$DIR_DEST_SBIN/alcasar-profil.sh --list
534
	else   # mise à jour des versions < 2.1
535
	else   # mise à jour des versions < 2.1
535
		if ([ $MAJ_RUNNING_VERSION -lt 2 ] || ([ $MAJ_RUNNING_VERSION -eq 2 ] && [ $MIN_RUNNING_VERSION -lt 1 ]))
536
		if ([ $MAJ_RUNNING_VERSION -lt 2 ] || ([ $MAJ_RUNNING_VERSION -eq 2 ] && [ $MIN_RUNNING_VERSION -lt 1 ]))
536
			then
537
			then
-
 
538
			if [ $Lang == "fr" ]
-
 
539
			then 
537
			echo "Cette mise à jour nécessite de redéfinir le premier compte d'administration du portail"
540
				echo "Cette mise à jour nécessite de redéfinir le premier compte d'administration du portail"
538
			echo
541
				echo
539
			echo -n "Nom : "
542
				echo -n "Nom : "
-
 
543
			else
-
 
544
				echo "This update need to redefine the first admin account"
-
 
545
				echo
-
 
546
				echo -n "Account : "
-
 
547
			fi
540
			read admin_portail
548
			read admin_portal
541
			echo "- Name of the first user of admin profile : $admin_portail" >> $FIC_PARAM
549
			echo "- Name of the first account of the admin profile : $admin_portal" >> $FIC_PARAM
542
			[ -d $DIR_DEST_ETC/digest ] && rm -rf $DIR_DEST_ETC/digest
550
			[ -d $DIR_DEST_ETC/digest ] && rm -rf $DIR_DEST_ETC/digest
543
			mkdir -p $DIR_DEST_ETC/digest
551
			mkdir -p $DIR_DEST_ETC/digest
544
			chmod 755 $DIR_DEST_ETC/digest
552
			chmod 755 $DIR_DEST_ETC/digest
545
			until [ -s $DIR_DEST_ETC/digest/key_admin ]
553
			until [ -s $DIR_DEST_ETC/digest/key_admin ]
546
			do
554
			do
547
				/usr/sbin/htdigest -c $DIR_DEST_ETC/digest/key_admin $HOSTNAME $admin_portail
555
				/usr/sbin/htdigest -c $DIR_DEST_ETC/digest/key_admin $HOSTNAME $admin_portal
548
			done
556
			done
549
			$DIR_DEST_SBIN/alcasar-profil.sh --list
557
			$DIR_DEST_SBIN/alcasar-profil.sh --list
550
		fi
558
		fi
551
	fi
559
	fi
552
# synchronisation horaire
560
# synchronisation horaire
Line 840... Line 848...
840
include		$DIR_DEST_ETC/alcasar-macallowed
848
include		$DIR_DEST_ETC/alcasar-macallowed
841
EOF
849
EOF
842
# création du fichier d'allocation d'adresses IP statiques
850
# création du fichier d'allocation d'adresses IP statiques
843
	touch $DIR_DEST_ETC/alcasar-ethers
851
	touch $DIR_DEST_ETC/alcasar-ethers
844
# création des fichiers de sites, d'urls et d'adresses MAC de confiance
852
# création des fichiers de sites, d'urls et d'adresses MAC de confiance
845
	echo -e "uamallowed=\"\"" > $DIR_DEST_ETC/alcasar-uamallowed
-
 
846
	echo -e "uamdomain=\"\"" > $DIR_DEST_ETC/alcasar-uamdomain
853
	touch $DIR_DEST_ETC/alcasar-macallowed $DIR_DEST_ETC/alcasar-uamallowed $DIR_DEST_ETC/alcasar-uamdomain
847
	touch $DIR_DEST_ETC/alcasar-macallowed
-
 
848
	chown root:apache $DIR_DEST_ETC/alcasar-*
854
	chown root:apache $DIR_DEST_ETC/alcasar-*
849
	chmod 660 $DIR_DEST_ETC/alcasar-*
855
	chmod 660 $DIR_DEST_ETC/alcasar-*
850
	echo "- User disconnect URL : http://alcasar:3990/logoff" >> $FIC_PARAM
856
	echo "- User disconnect URL : http://alcasar:3990/logoff" >> $FIC_PARAM
851
# Configuration des fichier WEB d'interception (secret partagé avec coova-chilli et nom d'organisme)
857
# Configuration des fichier WEB d'interception (secret partagé avec coova-chilli et nom d'organisme)
852
	$SED "s?^\$uamsecret =.*?\$uamsecret = \"$secretuam\";?g" $DIR_WEB/intercept.php
858
	$SED "s?^\$uamsecret =.*?\$uamsecret = \"$secretuam\";?g" $DIR_WEB/intercept.php