Subversion Repositories ALCASAR

Rev

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

Rev 120 Rev 123
Line 1... Line 1...
1
#!/bin/sh
1
#!/bin/sh
2
#  $Id: alcasar.sh 120 2010-05-20 20:14:03Z franck $ 
2
#  $Id: alcasar.sh 123 2010-05-20 20:47:01Z 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 408... Line 408...
408
# Configuration du serveur dhcpd
408
# Configuration du serveur dhcpd
409
	[ -e /etc/dhcpd.conf.default ] || cp /etc/dhcpd.conf /etc/dhcpd.conf.default 2> /dev/null
409
	[ -e /etc/dhcpd.conf.default ] || cp /etc/dhcpd.conf /etc/dhcpd.conf.default 2> /dev/null
410
	cat <<EOF > /etc/dhcpd.conf
410
	cat <<EOF > /etc/dhcpd.conf
411
ddns-update-style interim;
411
ddns-update-style interim;
412
subnet $PRIVATE_NETWORK netmask $PRIVATE_MASK {
412
subnet $PRIVATE_NETWORK netmask $PRIVATE_MASK {
413
option routers $PRIVATE_IP;
413
  option routers $PRIVATE_IP;
414
option subnet-mask $PRIVATE_MASK;
414
  option subnet-mask $PRIVATE_MASK;
415
option domain-name-servers $PRIVATE_IP;
415
  option domain-name-servers $PRIVATE_IP;
-
 
416
  option domain-name "localdomain";
416
range dynamic-bootp $PRIVATE_DYN_LAST_IP $PRIVATE_DYN_FIRST_IP;
417
  range dynamic-bootp $PRIVATE_DYN_LAST_IP $PRIVATE_DYN_FIRST_IP;
417
default-lease-time 21600;
418
  default-lease-time 21600;
418
max-lease-time 43200;
419
  max-lease-time 43200;
419
}
420
}
-
 
421
log-facility	local3;
-
 
422
## Exemple reservation @IP fixe sur @MAC
-
 
423
# host MACHINE1  {
-
 
424
#      hardware ethernet 00:06:9a:f3:07:01;
-
 
425
#      fixed-address 192.168.182.140;
-
 
426
# }
420
EOF
427
EOF
421
# écoute côté LAN seulement
428
# écoute côté LAN seulement
422
	[ -e /etc/sysconfig/dhcpd.default ] || cp /etc/sysconfig/dhcpd /etc/sysconfig/dhcpd.default 2> /dev/null
429
	[ -e /etc/sysconfig/dhcpd.default ] || cp /etc/sysconfig/dhcpd /etc/sysconfig/dhcpd.default 2> /dev/null
423
	$SED "s?^#INTERFACES=.*?INTERFACES=\"$INTIF\"?g" /etc/sysconfig/dhcpd
430
	$SED "s?^#INTERFACES=.*?INTERFACES=\"$INTIF\"?g" /etc/sysconfig/dhcpd
424
	/sbin/chkconfig --level 345 dhcpd on
431
	/sbin/chkconfig --level 345 dhcpd on