Subversion Repositories ALCASAR

Rev

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

Rev 1827 Rev 1850
Line 1... Line 1...
1
#/bin/bash
1
#/bin/bash
2
# $Id: alcasar-conf.sh 1827 2016-04-19 09:47:29Z raphael.pion $
2
# $Id: alcasar-conf.sh 1850 2016-04-28 20:41:53Z 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
HOSTNAME="alcasar"
28
HOSTNAME="alcasar"
28
DB_USER="radius"
29
DB_USER="radius"
29
radiuspwd=""
30
radiuspwd=""
30
SED="/bin/sed -i"
31
SED="/bin/sed -i"
31
RUNNING_VERSION=`cat $VERSION|cut -d" " -f1`
32
RUNNING_VERSION=`cat $VERSION|cut -d" " -f1`
Line 231... Line 232...
231
 
232
 
232
# Logout everybody
233
# Logout everybody
233
			$DIR_BIN/alcasar-logout.sh all		
234
			$DIR_BIN/alcasar-logout.sh all		
234
# Services stop
235
# Services stop
235
			echo -n "Stop services : "
236
			echo -n "Stop services : "
236
			for i in ntpd tinyproxy dnsmasq dnsmasq-whitelist dnsmasq-blacklist chilli network
237
			for i in ntpd tinyproxy dnsmasq dnsmasq-whitelist dnsmasq-blacklist dnsmasq-blackhole chilli network
237
			do
238
			do
238
				/usr/bin/systemctl stop $i && echo -n "$i, "
239
				/usr/bin/systemctl stop $i && echo -n "$i, "
239
			done
240
			done
240
			/usr/bin/kill -s SIGSTOP $(pidof httpd)
241
			/usr/bin/kill -s SIGSTOP $(pidof httpd)
241
			echo
242
			echo
Line 258... Line 259...
258
IPV6INIT=no
259
IPV6INIT=no
259
IPV6TO4INIT=no
260
IPV6TO4INIT=no
260
ACCOUNTING=no
261
ACCOUNTING=no
261
USERCTL=no
262
USERCTL=no
262
MTU=$MTU
263
MTU=$MTU
-
 
264
NOZEROCONF=yes
263
EOF
265
EOF
264
		else	
266
		else	
265
			cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-$EXTIF
267
			cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-$EXTIF
266
DEVICE=$EXTIF
268
DEVICE=$EXTIF
267
BOOTPROTO=static
269
BOOTPROTO=static
Line 276... Line 278...
276
IPV6INIT=no
278
IPV6INIT=no
277
IPV6TO4INIT=no
279
IPV6TO4INIT=no
278
ACCOUNTING=no
280
ACCOUNTING=no
279
USERCTL=no
281
USERCTL=no
280
MTU=$MTU
282
MTU=$MTU
-
 
283
NOZEROCONF=yes
281
EOF
284
EOF
282
		fi
285
		fi
283
# INTIF config (for bypass mode only)
286
# INTIF config (for bypass mode only)
284
		$SED "s?^IPADDR=.*?IPADDR=$PRIVATE_IP?" /etc/sysconfig/network-scripts/bypass-ifcfg-$INTIF
287
		$SED "s?^IPADDR=.*?IPADDR=$PRIVATE_IP?" /etc/sysconfig/network-scripts/bypass-ifcfg-$INTIF
285
		$SED "s?^NETMASK=.*?NETMASK=$PRIVATE_NETMASK?" /etc/sysconfig/network-scripts/bypass-ifcfg-$INTIF
288
		$SED "s?^NETMASK=.*?NETMASK=$PRIVATE_NETMASK?" /etc/sysconfig/network-scripts/bypass-ifcfg-$INTIF