Line 1... |
Line 1... |
1 |
#!/bin/sh
|
1 |
#!/bin/sh
|
2 |
# $Id: alcasar.sh 227 2010-09-02 20:51:15Z franck $
|
2 |
# $Id: alcasar.sh 228 2010-09-02 21:05:15Z 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 1041... |
Line 1041... |
1041 |
param_dnsmasq ()
|
1041 |
param_dnsmasq ()
|
1042 |
{
|
1042 |
{
|
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 |
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 |
$SED "s?^DHCP_LEASE=.*?DHCP_LEASE=/var/log/dnsmasq/lease.log?g" /etc/sysconfig/dnsmasq
|
1054 |
chown root:apache /usr/local/etc/alcasar-dnsmasq-filter # modifiable par apache et interface de gestion
|
1055 |
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
|
1056 |
chmod -R g+rw /usr/local/etc/alcasar-dnsmasq-filter
|
1056 |
}
|
1057 |
}
|
1057 |
|
1058 |
|
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 |
# 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 ...
|