Line 1... |
Line 1... |
1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
2 |
# $Id: alcasar.sh 704 2011-09-12 04:48:06Z franck $
|
2 |
# $Id: alcasar.sh 706 2011-09-12 19:19:44Z 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 1099... |
Line 1099... |
1099 |
bogus-priv
|
1099 |
bogus-priv
|
1100 |
filterwin2k
|
1100 |
filterwin2k
|
1101 |
server=$DNS1
|
1101 |
server=$DNS1
|
1102 |
server=$DNS2
|
1102 |
server=$DNS2
|
1103 |
EOF
|
1103 |
EOF
|
1104 |
# On crée le fichier de résolution locale
|
1104 |
# Adaptation du domaine local
|
1105 |
cat << EOF >> $DIR_DEST_ETC/alcasar-dns-name
|
1105 |
$SED "?\$DOMAIN?$DOMAIN?g" $DIR_DEST_ETC/alcasar-dns-name
|
1106 |
# Here you can define your local domain name
|
- |
|
1107 |
# use the /etc/hosts file to define your hosts name
|
- |
|
1108 |
local=/$DOMAIN/
|
- |
|
1109 |
EOF
|
- |
|
1110 |
# On modifie le fichier d'initialisattion (lancement et arret de la deuxième instance)
|
1106 |
# On modifie le fichier d'initialisattion (lancement et arret de la deuxième instance)
|
1111 |
[ -e /etc/init.d/dnsmasq.default ] || cp /etc/init.d/dnsmasq /etc/init.d/dnsmasq.default
|
1107 |
[ -e /etc/init.d/dnsmasq.default ] || cp /etc/init.d/dnsmasq /etc/init.d/dnsmasq.default
|
1112 |
$SED "/daemon/a \$dnsmasq -C /etc/dnsmasq-blackhole.conf \$OPTIONS" /etc/init.d/dnsmasq
|
1108 |
$SED "/daemon/a \$dnsmasq -C /etc/dnsmasq-blackhole.conf \$OPTIONS" /etc/init.d/dnsmasq
|
1113 |
$SED "/killproc \$DAEMON_NAME/a killproc \$DAEMON_NAME" /etc/init.d/dnsmasq
|
1109 |
$SED "/killproc \$DAEMON_NAME/a killproc \$DAEMON_NAME" /etc/init.d/dnsmasq
|
1114 |
} # End dnsmasq
|
1110 |
} # End dnsmasq
|
Line 1281... |
Line 1277... |
1281 |
cp -f $DIR_CONF/sudoers /etc/. ; chmod 440 /etc/sudoers ; chown root:root /etc/sudoers
|
1277 |
cp -f $DIR_CONF/sudoers /etc/. ; chmod 440 /etc/sudoers ; chown root:root /etc/sudoers
|
1282 |
$SED "s?^Host_Alias.*?Host_Alias LAN_ORG=$PRIVATE_NETWORK/$PRIVATE_NETMASK,localhost #réseau de l'organisme?g" /etc/sudoers
|
1278 |
$SED "s?^Host_Alias.*?Host_Alias LAN_ORG=$PRIVATE_NETWORK/$PRIVATE_NETMASK,localhost #réseau de l'organisme?g" /etc/sudoers
|
1283 |
# prise en compte de la rotation des logs sur 1 an (concerne mysql, httpd, dansguardian, squid, radiusd, ulogd)
|
1279 |
# prise en compte de la rotation des logs sur 1 an (concerne mysql, httpd, dansguardian, squid, radiusd, ulogd)
|
1284 |
cp -f $DIR_CONF/logrotate.d/* /etc/logrotate.d/
|
1280 |
cp -f $DIR_CONF/logrotate.d/* /etc/logrotate.d/
|
1285 |
chmod 644 /etc/logrotate.d/*
|
1281 |
chmod 644 /etc/logrotate.d/*
|
- |
|
1282 |
# rectification sur version précédente de la compression des logs
|
- |
|
1283 |
$SED "s?^delaycompress.*?#&?g" /etc/logrotate.conf
|
- |
|
1284 |
# actualisation des fichiers logs compressés
|
- |
|
1285 |
for file in firewall squid dansguardian httpd
|
- |
|
1286 |
do
|
- |
|
1287 |
find /var/log/$file -type f -name *.log-2011[0-9][0-9][0-9][0-9] -exec gzip {} \;
|
- |
|
1288 |
done
|
- |
|
1289 |
# export des logs en 'retard' dans /var/Save/logs
|
- |
|
1290 |
/usr/local/bin/alcasar-log-export.sh
|
1286 |
# processus lancés par défaut au démarrage
|
1291 |
# processus lancés par défaut au démarrage
|
1287 |
for i in ntpd iptables ulogd dnsmasq squid chilli httpd radiusd mysqld dansguardian havp freshclam
|
1292 |
for i in ntpd iptables ulogd dnsmasq squid chilli httpd radiusd mysqld dansguardian havp freshclam
|
1288 |
do
|
1293 |
do
|
1289 |
/sbin/chkconfig --add $i
|
1294 |
/sbin/chkconfig --add $i
|
1290 |
done
|
1295 |
done
|