Subversion Repositories ALCASAR

Rev

Rev 1563 | Rev 1566 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log

Rev 1563 Rev 1564
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 1563 2015-02-03 18:03:47Z franck $ 
2
#  $Id: alcasar.sh 1564 2015-02-09 23:18:36Z 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 54... Line 54...
54
mode="install"
54
mode="install"
55
# ******* Files parameters - paramètres fichiers *********
55
# ******* Files parameters - paramètres fichiers *********
56
DIR_INSTALL=`pwd`				# current directory 
56
DIR_INSTALL=`pwd`				# current directory 
57
DIR_CONF="$DIR_INSTALL/conf"			# install directory (with conf files)
57
DIR_CONF="$DIR_INSTALL/conf"			# install directory (with conf files)
58
DIR_SCRIPTS="$DIR_INSTALL/scripts"		# install directory (with script files)
58
DIR_SCRIPTS="$DIR_INSTALL/scripts"		# install directory (with script files)
59
DIR_SAVE="/var/Save"				# backup directory (system_backup, user_db_backup, logs)
59
DIR_SAVE="/var/Save"				# backup directory (traceability_log, user_db, security_log)
60
DIR_WEB="/var/www/html"				# directory of APACHE
60
DIR_WEB="/var/www/html"				# directory of APACHE
61
DIR_DG="/etc/dansguardian"			# directory of DansGuardian
61
DIR_DG="/etc/dansguardian"			# directory of DansGuardian
62
DIR_ACC="$DIR_WEB/acc"				# directory of the 'ALCASAR Control Center'
62
DIR_ACC="$DIR_WEB/acc"				# directory of the 'ALCASAR Control Center'
63
DIR_DEST_BIN="/usr/local/bin"			# directory of ALCASAR scripts
63
DIR_DEST_BIN="/usr/local/bin"			# directory of ALCASAR scripts
64
DIR_DEST_SBIN="/usr/local/sbin"			# directory of ALCASAR admin scripts
64
DIR_DEST_SBIN="/usr/local/sbin"			# directory of ALCASAR admin scripts
Line 169... Line 169...
169
		done
169
		done
170
		if [ "$response" = "n" ] || [ "$response" = "N" ] 
170
		if [ "$response" = "n" ] || [ "$response" = "N" ] 
171
		then
171
		then
172
			rm -f /tmp/alcasar-conf*
172
			rm -f /tmp/alcasar-conf*
173
		else
173
		else
174
# Create a backup of running importants files
174
# Create the current conf file
175
			$DIR_SCRIPTS/alcasar-conf.sh --create
175
			$DIR_SCRIPTS/alcasar-conf.sh --create
176
			mode="update"
176
			mode="update"
177
		fi
177
		fi
178
	fi
178
	fi
179
	if [[ ( $unknown_os != 3 ) || ("$DISTRIBUTION" != "Mageia" ) || ( "$CURRENT_VERSION" != "4" ) ]]
179
	if [[ ( $unknown_os != 3 ) || ("$DISTRIBUTION" != "Mageia" ) || ( "$CURRENT_VERSION" != "4" ) ]]
Line 643... Line 643...
643
	$SED "s?\$radiuspwd = .*?\$radiuspwd = \"$radiuspwd\"\;?g" $DIR_ACC/phpsysinfo/includes/xml/portail.php
643
	$SED "s?\$radiuspwd = .*?\$radiuspwd = \"$radiuspwd\"\;?g" $DIR_ACC/phpsysinfo/includes/xml/portail.php
644
	chmod 640 $DIR_ACC/phpsysinfo/includes/xml/portail.php
644
	chmod 640 $DIR_ACC/phpsysinfo/includes/xml/portail.php
645
	chown -R apache:apache $DIR_WEB/*
645
	chown -R apache:apache $DIR_WEB/*
646
# create the backup structure :
646
# create the backup structure :
647
# - base = users database
647
# - base = users database
648
# - system_backup = alcasar conf file + users database
-
 
649
# - archive = tarball of "base + http firewall + netflow"
648
# - archive = tarball of "base + http firewall + netflow"
650
# - security = watchdog disconnection)
649
# - security = watchdog disconnection)
651
	for i in system_backup base archive security;
650
	for i in base archive security;
652
	do
651
	do
653
		[ -d $DIR_SAVE/$i ] || mkdir -p $DIR_SAVE/$i
652
		[ -d $DIR_SAVE/$i ] || mkdir -p $DIR_SAVE/$i
654
	done
653
	done
655
	chown -R root:apache $DIR_SAVE
654
	chown -R root:apache $DIR_SAVE
656
# Configuration et sécurisation php
655
# Configuration et sécurisation php