Subversion Repositories ALCASAR

Rev

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

Rev 220 Rev 221
Line 1... Line 1...
1
#!/bin/sh
1
#!/bin/sh
2
#  $Id: alcasar.sh 220 2010-08-30 23:58:50Z jeremy $ 
2
#  $Id: alcasar.sh 221 2010-08-31 06:55:40Z 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 1043... Line 1043...
1043
	[ -d /etc/dnsmasq.d ] || mkdir /etc/dnsmasq.d
1043
	[ -d /etc/dnsmasq.d ] || mkdir /etc/dnsmasq.d
1044
	[ -d /var/log/dnsmasq ] || mkdir /var/log/dnsmasq
1044
	[ -d /var/log/dnsmasq ] || mkdir /var/log/dnsmasq
1045
	[ -e /etc/dnsmasq.conf ] || cp /etc/dnsmasq.conf /etc/dnsmasq.conf.default
1045
	[ -e /etc/dnsmasq.conf ] || cp /etc/dnsmasq.conf /etc/dnsmasq.conf.default
1046
	$SED "s?^[^#]?#&?g" /etc/dnsmasq.conf # (on commente ce qui ne l'est pas)
1046
	$SED "s?^[^#]?#&?g" /etc/dnsmasq.conf # (on commente ce qui ne l'est pas)
1047
	cp -f $DIR_CONF/alcasar-dnsmasq.conf /etc/dnsmasq.d/.
1047
	cp -f $DIR_CONF/alcasar-dnsmasq.conf /etc/dnsmasq.d/.
1048
	cp -f $DIR_CONF/alcasar-dnsmasq-filter $DIR_DEST_ETC && ln -s $DIR_DEST_ETC/alcasar-dnsmasq-filter /etc/dnsmasq.d/
1048
	ln -s $DIR_DEST_ETC/alcasar-dnsmasq-filter /etc/dnsmasq.d/
1049
	$SED "s?^#conf-dir=.*?conf-dir=/etc/dnsmasq.d?g" /etc/dnsmasq.conf		# les fichiers de config se trouvent dans /etc/dnsmasq.d/*
1049
	$SED "s?^#conf-dir=.*?conf-dir=/etc/dnsmasq.d?g" /etc/dnsmasq.conf		# les fichiers de config se trouvent dans /etc/dnsmasq.d/*
1050
	$SED "s?^#except-interface=.*?except-interface=$EXTIF?g" /etc/dnsmasq.d/alcasar-dnsmasq.conf
1050
	$SED "s?^#except-interface=.*?except-interface=$EXTIF?g" /etc/dnsmasq.d/alcasar-dnsmasq.conf
1051
	$SED "s?^domain=.*?domain=$DOMAIN?g" /etc/dnsmasq.d/alcasar-dnsmasq.conf
1051
	$SED "s?^domain=.*?domain=$DOMAIN?g" /etc/dnsmasq.d/alcasar-dnsmasq.conf
1052
	$SED "s?^#dhcp-range=.*?dhcp-range=$ORGANISME,$PRIVATE_DYN_FIRST_IP,$PRIVATE_DYN_LAST_IP,$PRIVATE_NETMASK,12h?g" /etc/dnsmasq.d/alcasar-dnsmasq.conf
1052
	$SED "s?^#dhcp-range=.*?dhcp-range=$ORGANISME,$PRIVATE_DYN_FIRST_IP,$PRIVATE_DYN_LAST_IP,$PRIVATE_NETMASK,12h?g" /etc/dnsmasq.d/alcasar-dnsmasq.conf
1053
	$SED "s?^#listen-address=.*?listen-address=$PRIVATE_IP?g" /etc/dnsmasq.d/alcasar-dnsmasq.conf
1053
	$SED "s?^#listen-address=.*?listen-address=$PRIVATE_IP?g" /etc/dnsmasq.d/alcasar-dnsmasq.conf
1054
	chown root:apache /usr/local/etc/alcasar-dnsmasq-filter	# modifiable par apache et interface de gestion
1054
	chown root:apache /usr/local/etc/alcasar-dnsmasq-filter	# modifiable par apache et interface de gestion
1055
	chmod -R g+rw /usr/local/etc/alcasar-dnsmasq-filter
1055
	chmod -R g+rw /usr/local/etc/alcasar-dnsmasq-filter
1056
}
1056
}
1057
 
1057
 
1058
# début de zone à supprimer depuis intégration de dnsmasq ; reste à intégrer les zones directes des hotes du reso local et le reverse ...
1058
# début de zone à supprimer depuis intégration de dnsmasq ; reste à intégrer les zones directes des hôtes du réseau local et le reverse ...
1059
param_bind ()
1059
param_bind ()
1060
{
1060
{
1061
	ln -sf /var/lib/named/etc/trusted_networks_acl.conf /etc/
1061
	ln -sf /var/lib/named/etc/trusted_networks_acl.conf /etc/
1062
	ln -sf /var/lib/named/etc/named.conf /etc/
1062
	ln -sf /var/lib/named/etc/named.conf /etc/
1063
	ln -sf /var/lib/named/var/named /var/
1063
	ln -sf /var/lib/named/var/named /var/