Subversion Repositories ALCASAR

Rev

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

Rev 1268 Rev 1269
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 1268 2013-12-15 22:59:24Z richard $ 
2
#  $Id: alcasar.sh 1269 2013-12-16 23:13:20Z 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   # update needed for versions previous then 2.8 due to the integration of the domain name ("localdomain" by default)
-
 
604
		if [ $MAJ_PREVIOUS_VERSION -lt 2 ] || ([ $MAJ_PREVIOUS_VERSION -eq 2 ] && [ $MIN_PREVIOUS_VERSION -lt 8 ])
-
 
605
			then
-
 
606
			if [ $Lang == "fr" ]
-
 
607
			then 
-
 
608
				echo "Cette mise à jour nécessite de redéfinir le premier compte d'administration du portail"
-
 
609
				echo
-
 
610
				echo -n "Nom : "
-
 
611
			else
-
 
612
				echo "This update need to redefine the first admin account"
-
 
613
				echo
-
 
614
				echo -n "Account : "
-
 
615
			fi
-
 
616
			read admin_portal
-
 
617
			[ -d $DIR_DEST_ETC/digest ] && rm -rf $DIR_DEST_ETC/digest
-
 
618
			mkdir -p $DIR_DEST_ETC/digest
-
 
619
			chmod 755 $DIR_DEST_ETC/digest
-
 
620
			until [ -s $DIR_DEST_ETC/digest/key_admin ]
-
 
621
			do
-
 
622
				/usr/sbin/htdigest -c $DIR_DEST_ETC/digest/key_admin $HOSTNAME.$DOMAIN $admin_portal
-
 
623
			done
-
 
624
			$DIR_DEST_SBIN/alcasar-profil.sh --list
-
 
625
		fi
-
 
626
	fi
603
	fi
627
# synchronisation horaire
604
# synchronisation horaire
628
	ntpd -q -g &
605
	ntpd -q -g &
629
# Sécurisation du centre
606
# Sécurisation du centre
630
	rm -f /etc/httpd/conf/webapps.d/alcasar*
607
	rm -f /etc/httpd/conf/webapps.d/alcasar*
Line 1652... Line 1629...
1652
		PARENT_SCRIPT=`basename $0`
1629
		PARENT_SCRIPT=`basename $0`
1653
		export PARENT_SCRIPT # to avoid stop&start process during the installation process
1630
		export PARENT_SCRIPT # to avoid stop&start process during the installation process
1654
		$DIR_DEST_BIN/alcasar-conf.sh --apply
1631
		$DIR_DEST_BIN/alcasar-conf.sh --apply
1655
		$SED "s?^INSTALL_DATE=.*?INSTALL_DATE=$DATE?g" $CONF_FILE
1632
		$SED "s?^INSTALL_DATE=.*?INSTALL_DATE=$DATE?g" $CONF_FILE
1656
		$SED "s?^VERSION=.*?VERSION=$VERSION?g" $CONF_FILE
1633
		$SED "s?^VERSION=.*?VERSION=$VERSION?g" $CONF_FILE
-
 
1634
		if [ $MAJ_PREVIOUS_VERSION -lt 2 ] || ([ $MAJ_PREVIOUS_VERSION -eq 2 ] && [ $MIN_PREVIOUS_VERSION -lt 8 ])
-
 
1635
		# update needed for versions previous then 2.8 due to the integration of the domainname ("localdomain" by default)
-
 
1636
		then
-
 
1637
			header_install
-
 
1638
			if [ $Lang == "fr" ]
-
 
1639
			then 
-
 
1640
				echo "Cette mise à jour nécessite de redéfinir le premier compte d'administration du portail"
-
 
1641
				echo
-
 
1642
				echo -n "Nom : "
-
 
1643
			else
-
 
1644
				echo "This update need to redefine the first admin account"
-
 
1645
				echo
-
 
1646
				echo -n "Account : "
-
 
1647
			fi
-
 
1648
			read admin_portal
-
 
1649
			[ -d $DIR_DEST_ETC/digest ] && rm -rf $DIR_DEST_ETC/digest
-
 
1650
			mkdir -p $DIR_DEST_ETC/digest
-
 
1651
			chmod 755 $DIR_DEST_ETC/digest
-
 
1652
			until [ -s $DIR_DEST_ETC/digest/key_admin ]
-
 
1653
			do
-
 
1654
				/usr/sbin/htdigest -c $DIR_DEST_ETC/digest/key_admin $HOSTNAME.$DOMAIN $admin_portal
-
 
1655
			done
-
 
1656
			$DIR_DEST_SBIN/alcasar-profil.sh --list
-
 
1657
		fi
1657
	fi
1658
	fi
1658
	rm -f /tmp/alcasar-conf*
1659
	rm -f /tmp/alcasar-conf*
1659
	chown -R root:apache $DIR_DEST_ETC/*
1660
	chown -R root:apache $DIR_DEST_ETC/*
1660
	chmod -R 660 $DIR_DEST_ETC/*
1661
	chmod -R 660 $DIR_DEST_ETC/*
1661
	chmod ug+x $DIR_DEST_ETC/digest
1662
	chmod ug+x $DIR_DEST_ETC/digest