Subversion Repositories ALCASAR

Rev

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

Rev 1866 Rev 1890
Line 1... Line 1...
1
#/bin/bash
1
#/bin/bash
2
# $Id: alcasar-conf.sh 1866 2016-05-04 07:45:11Z franck $
2
# $Id: alcasar-conf.sh 1890 2016-05-17 16:08:51Z franck $
3
 
3
 
4
# alcasar-conf.sh
4
# alcasar-conf.sh
5
# by REXY
5
# by REXY
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 22... Line 22...
22
DIR_ETC="/usr/local/etc"			# répertoire des fichiers de conf
22
DIR_ETC="/usr/local/etc"			# répertoire des fichiers de conf
23
CONF_FILE="$DIR_ETC/alcasar.conf"		# main alcasar conf file
23
CONF_FILE="$DIR_ETC/alcasar.conf"		# main alcasar conf file
24
VERSION="/var/www/html/VERSION"			# contient la version en cours
24
VERSION="/var/www/html/VERSION"			# contient la version en cours
25
EXTIF=`grep ^EXTIF= $CONF_FILE|cut -d"=" -f2`	# EXTernal InterFace
25
EXTIF=`grep ^EXTIF= $CONF_FILE|cut -d"=" -f2`	# EXTernal InterFace
26
INTIF=`grep ^INTIF= $CONF_FILE|cut -d"=" -f2`	# INTernal InterFace
26
INTIF=`grep ^INTIF= $CONF_FILE|cut -d"=" -f2`	# INTernal InterFace
27
MTU=`grep ^PUBLIC_MTU= $CONF_FILE|cut -d"=" -f2`	# INTernal InterFace
27
MTU=`grep ^PUBLIC_MTU= $CONF_FILE|cut -d"=" -f2` # INTernal InterFace
-
 
28
DHCP_mode=`grep ^DHCP= $CONF_FILE|cut -d"=" -f2`
-
 
29
INT_DNS_mode=`grep ^INT_DNS_ACTIVE= $CONF_FILE|cut -d"=" -f2`
-
 
30
LDAP_mode=`grep ^LDAP= $CONF_FILE|cut -d"=" -f2`
28
HOSTNAME="alcasar"
31
HOSTNAME="alcasar"
29
DB_USER="radius"
32
DB_USER="radius"
30
radiuspwd=""
33
radiuspwd=""
31
SED="/bin/sed -i"
34
SED="/bin/sed -i"
32
RUNNING_VERSION=`cat $VERSION|cut -d" " -f1`
35
RUNNING_VERSION=`cat $VERSION|cut -d" " -f1`
Line 55... Line 58...
55
usage="Usage: alcasar-conf.sh {--create or -create} | {--load or -load} | {--apply or -apply}"
58
usage="Usage: alcasar-conf.sh {--create or -create} | {--load or -load} | {--apply or -apply}"
56
nb_args=$#
59
nb_args=$#
57
args=$1
60
args=$1
58
if [ $nb_args -eq 0 ]
61
if [ $nb_args -eq 0 ]
59
then
62
then
60
	nb_args=1
63
	nb_args=100:26:6C:
61
	args="-h"
64
	args="-h"
62
fi
65
fi
63
case $args in
66
case $args in
64
	-\? | -h* | --h*)
67
	-\? | -h* | --h*)
65
		echo "$usage"
68
		echo "$usage"
Line 217... Line 220...
217
		ORGANISME=`grep ORGANISM $CONF_FILE|cut -d"=" -f2`
220
		ORGANISME=`grep ORGANISM $CONF_FILE|cut -d"=" -f2`
218
 		DOMAIN=`grep DOMAIN $CONF_FILE|cut -d"=" -f2`
221
 		DOMAIN=`grep DOMAIN $CONF_FILE|cut -d"=" -f2`
219
		DHCP_mode=`grep DHCP= $CONF_FILE|cut -d"=" -f2`
222
		DHCP_mode=`grep DHCP= $CONF_FILE|cut -d"=" -f2`
220
		if [ "$PARENT_SCRIPT" != "alcasar.sh" ] # don't launch on install stage
223
		if [ "$PARENT_SCRIPT" != "alcasar.sh" ] # don't launch on install stage
221
		then
224
		then
222
			if [ $DHCP_mode = "off" ]
225
			if [ $DHCP_mode = "off" ] || [ $DHCP_mode = "Off" ] || [ $DHCP_mode = "OFF" ]
223
			then
226
			then
224
				$DIR_BIN/alcasar-dhcp.sh --off
227
				$DIR_BIN/alcasar-dhcp.sh --off
-
 
228
			else
-
 
229
			        $DIR_BIN/alcasar-dhcp.sh --on
225
			fi
230
			fi
226
 
231
 
227
# Implementation of the local DNS
232
# Implementation of the local DNS
-
 
233
			if [ $INT_DNS_mode = "on" ] || [ $INT_DNS_mode = "On" ] || [ $INT_DNS_mode = "ON" ]
-
 
234
			then
-
 
235
				$DIR_BIN/alcasar-dns-local.sh --on
-
 
236
			else
228
			$DIR_BIN/alcasar-dns-local.sh --$INT_DNS_active
237
				$DIR_BIN/alcasar-dns-local.sh --off
-
 
238
			fi
229
			
239
			
230
# Implementation of the authentification LDAP
240
# Implementation of the authentification LDAP
-
 
241
#			if [ LDAP_mode = "on" ] || [ $LDAP_mode = "On" ] || [ $LDAP_mode = "ON" ]
-
 
242
#			then
231
#			$DIR_BIN/alcasar-ldap.sh --$INT_LDAP_active
243
#				$DIR_BIN/alcasar-ldap.sh
-
 
244
#			fi
232
 
245
 
233
# Logout everybody
246
# Logout everybody
234
			$DIR_BIN/alcasar-logout.sh all		
247
			$DIR_BIN/alcasar-logout.sh all		
235
# Services stop
248
# Services stop
236
			echo -n "Stop services : "
249
			echo -n "Stop services : "