Subversion Repositories ALCASAR

Rev

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

Rev 460 Rev 461
Line 1... Line 1...
1
#!/bin/sh
1
#!/bin/sh
2
#  $Id: alcasar.sh 460 2011-01-17 22:22:16Z richard $ 
2
#  $Id: alcasar.sh 461 2011-01-18 21:10:27Z 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 771... Line 771...
771
## - Paramètrage du fichier d'initialisation et de configuration de coova-chilli	##
771
## - Paramètrage du fichier d'initialisation et de configuration de coova-chilli	##
772
## - Paramètrage de la page d'authentification (intercept.php)				##
772
## - Paramètrage de la page d'authentification (intercept.php)				##
773
##########################################################################################
773
##########################################################################################
774
param_chilli ()
774
param_chilli ()
775
{
775
{
-
 
776
# modification du fichier d'initialisation
-
 
777
	[ -e /etc/init.d/chilli.default ] || cp /etc/init.d/chilli /etc/init.d/chilli.default
-
 
778
	# configuration d'eth1 (utile pour dnsmasq))
-
 
779
	$SED "s?ifconfig.*?ifconfig \$HS_LANIF $PRIVATE_IP?g" /etc/init.d/chilli
-
 
780
	# ajout de la fonction 'status' (utile pour la gestion du process)
-
 
781
	$SED "/^.*functions/i. /etc/init.d/functions" /etc/init.d/chilli
-
 
782
	$SED "/^[\t ]*stop)/i\    status)\n        status chilli\n        RETVAL=$?\n        ;;\n" /etc/init.d/chilli
-
 
783
	# insertion d'une tempo sur le 'restart' pour permettre à tun0 d'être libérée
-
 
784
	$SED "/^[\t ]*\$0 start/i\        sleep 2" /etc/init.d/chilli
-
 
785
	# suppression des fonctions 'writeconfig' et 'radiusconfig'
-
 
786
	$SED "/writeconfig/d" /etc/init.d/chilli
-
 
787
	$SED "/radiusconfig/d" /etc/init.d/chilli
-
 
788
	# suppression de warning disgracieux
-
 
789
	$SED "s?which start-stop-daemon?which start-stop-daemon 2>/dev/null?g" /etc/init.d/chilli
776
# création du fichier de conf
790
# création du fichier de conf
777
	[ -e /etc/chilli.conf.default ] || cp /etc/chilli.conf /etc/chilli.conf.default
791
	[ -e /etc/chilli.conf.default ] || cp /etc/chilli.conf /etc/chilli.conf.default
778
	cat <<EOF > /etc/chilli.conf
792
	cat <<EOF > /etc/chilli.conf
779
# coova config for ALCASAR
793
# coova config for ALCASAR
780
cmdsocket	/var/run/chilli.sock
794
cmdsocket	/var/run/chilli.sock
Line 1313... Line 1327...
1313
			do
1327
			do
1314
				echo "Voulez-vous effectuer une mise à jour (O/n)? ";
1328
				echo "Voulez-vous effectuer une mise à jour (O/n)? ";
1315
				echo -n "Do you want to update (Y/n)?";
1329
				echo -n "Do you want to update (Y/n)?";
1316
				read response
1330
				read response
1317
			done
1331
			done
1318
			if [ "$response" = "o" ] || [ "$response" = "O" || [ "$response" = "y" ] || [ "$response" = "Y" ]
1332
			if [ "$response" = "o" ] || [ "$response" = "O" ] || [ "$response" = "y" ] || [ "$response" = "Y" ]
1319
			then
1333
			then
1320
# On crée le fichier de conf de la version actuelle
1334
# On crée le fichier de conf de la version actuelle
1321
				chmod u+x $DIR_SCRIPTS/alcasar-conf.sh
1335
				chmod u+x $DIR_SCRIPTS/alcasar-conf.sh
1322
				$DIR_SCRIPTS/alcasar-conf.sh --create
1336
				$DIR_SCRIPTS/alcasar-conf.sh --create
1323
			fi
1337
			fi