Subversion Repositories ALCASAR

Rev

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

Rev 448 Rev 453
Line 1... Line 1...
1
#!/bin/sh
1
#!/bin/sh
2
#  $Id: alcasar.sh 448 2011-01-11 19:42:06Z stephane $ 
2
#  $Id: alcasar.sh 453 2011-01-14 10:48:39Z franck $ 
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 278... Line 278...
278
	echo "$secretuam" >> $FIC_PASSWD
278
	echo "$secretuam" >> $FIC_PASSWD
279
	secretradius=`cat /dev/urandom | tr -dc [:alnum:] | head -c8`	# secret partagé entre coova-chilli et FreeRadius
279
	secretradius=`cat /dev/urandom | tr -dc [:alnum:] | head -c8`	# secret partagé entre coova-chilli et FreeRadius
280
	echo -n "secret partagé entre coova-chilli et FreeRadius : " >> $FIC_PASSWD
280
	echo -n "secret partagé entre coova-chilli et FreeRadius : " >> $FIC_PASSWD
281
	echo "$secretradius" >> $FIC_PASSWD
281
	echo "$secretradius" >> $FIC_PASSWD
282
	chmod 640 $FIC_PASSWD
282
	chmod 640 $FIC_PASSWD
283
# On installe et on modifie les scripts d'Alcasar
283
# On installe les scripts et fichiers de configuration d'ALCASAR 
-
 
284
#  - dans /usr/local/bin :  alcasar-{CA.sh,conf.sh,import-clean.sh,iptables-bypass.sh,iptables.sh,log-clean.sh,log-export.sh,mondo.sh,watchdog.sh}
284
	cp -f $DIR_SCRIPTS/alcasar* $DIR_DEST_BIN/. ; chown root:root $DIR_DEST_BIN/alcasar* ; chmod 740 $DIR_DEST_BIN/alcasar*
285
	cp -f $DIR_SCRIPTS/alcasar* $DIR_DEST_BIN/. ; chown root:root $DIR_DEST_BIN/alcasar* ; chmod 740 $DIR_DEST_BIN/alcasar*
-
 
286
#  - dans /usr/local/sbin :  alcasar-{bl.sh,bypass.sh,dateLog.sh,havp.sh,logout.sh,mysql.sh,nf.sh,profil.sh,uninstall.sh,version-list.sh,load-balancing.sh}
285
	cp -f $DIR_SCRIPTS/sbin/alcasar* $DIR_DEST_SBIN/. ; chown root:root $DIR_DEST_SBIN/alcasar* ; chmod 740 $DIR_DEST_SBIN/alcasar*
287
	cp -f $DIR_SCRIPTS/sbin/alcasar* $DIR_DEST_SBIN/. ; chown root:root $DIR_DEST_SBIN/alcasar* ; chmod 740 $DIR_DEST_SBIN/alcasar*
-
 
288
#  - des fichiers de conf dans /usr/local/etc : alcasar-{bl-categories-enabled,dns-name,ethers,iptables-local.sh,services}
286
	cp -f $DIR_SCRIPTS/etc/alcasar* $DIR_DEST_ETC/. ; chown root:apache $DIR_DEST_ETC/alcasar* ; chmod 660 $DIR_DEST_ETC/alcasar*
289
	cp -f $DIR_SCRIPTS/etc/alcasar* $DIR_DEST_ETC/. ; chown root:apache $DIR_DEST_ETC/alcasar* ; chmod 660 $DIR_DEST_ETC/alcasar*
287
	$SED "s?^radiussecret.*?radiussecret=\"$secretradius\"?g" $DIR_DEST_SBIN/alcasar-logout.sh
290
	$SED "s?^radiussecret.*?radiussecret=\"$secretradius\"?g" $DIR_DEST_SBIN/alcasar-logout.sh
288
	$SED "s?^DB_RADIUS=.*?DB_RADIUS=\"$DB_RADIUS\"?g" $DIR_DEST_SBIN/alcasar-mysql.sh
291
	$SED "s?^DB_RADIUS=.*?DB_RADIUS=\"$DB_RADIUS\"?g" $DIR_DEST_SBIN/alcasar-mysql.sh
289
	$SED "s?^DB_USER=.*?DB_USER=\"$DB_USER\"?g" $DIR_DEST_SBIN/alcasar-mysql.sh $DIR_DEST_BIN/alcasar-conf.sh
292
	$SED "s?^DB_USER=.*?DB_USER=\"$DB_USER\"?g" $DIR_DEST_SBIN/alcasar-mysql.sh $DIR_DEST_BIN/alcasar-conf.sh
290
	$SED "s?^radiuspwd=.*?radiuspwd=\"$radiuspwd\"?g" $DIR_DEST_SBIN/alcasar-mysql.sh $DIR_DEST_BIN/alcasar-conf.sh
293
	$SED "s?^radiuspwd=.*?radiuspwd=\"$radiuspwd\"?g" $DIR_DEST_SBIN/alcasar-mysql.sh $DIR_DEST_BIN/alcasar-conf.sh
Line 830... Line 833...
830
coaport		3799
833
coaport		3799
831
include		/usr/local/etc/alcasar-uamallowed
834
include		/usr/local/etc/alcasar-uamallowed
832
include		/usr/local/etc/alcasar-uamdomain
835
include		/usr/local/etc/alcasar-uamdomain
833
include		/usr/local/etc/alcasar-macallowed
836
include		/usr/local/etc/alcasar-macallowed
834
EOF
837
EOF
-
 
838
# Pour la fonctionnalité de DHCP statique, le fichier alcasar-ethers a été copié précédemment dans /usr/local/etc
835
# création des fichiers de sites, d'urls et d'adresses MAC de confiance
839
# création des fichiers de sites, d'urls et d'adresses MAC de confiance
836
	echo -e "uamallowed=\"\"" > /usr/local/etc/alcasar-uamallowed
840
	echo -e "uamallowed=\"\"" > /usr/local/etc/alcasar-uamallowed
837
	echo -e "uamdomain=\"\"" > /usr/local/etc/alcasar-uamdomain
841
	echo -e "uamdomain=\"\"" > /usr/local/etc/alcasar-uamdomain
838
	echo -e "macallowed=\"\"" > /usr/local/etc/alcasar-macallowed
842
	echo -e "macallowed=\"\"" > /usr/local/etc/alcasar-macallowed
839
	chown root:apache /usr/local/etc/alcasar-*
843
	chown root:apache /usr/local/etc/alcasar-*