2,7 → 2,7 |
# $Id$ |
|
# alcasar-bypass.sh |
# by Franck BOUIJOUX and Richard REY |
# by 3abtux and Rexy |
# This script is distributed under the Gnu General Public License (GPL) |
|
# activation / désactivation du contournement de l'authentification et du filtrage WEB |
10,6 → 10,9 |
|
usage="Usage: alcasar-bypass.sh {--on or -on } | {--off or -off}" |
SED="/bin/sed -i" |
CONF_FILE="/usr/local/etc/alcasar.conf" |
INTIF=`grep ^INTIF= $CONF_FILE|cut -d"=" -f2` # INTernal InterFace |
|
nb_args=$# |
args=$1 |
if [ $nb_args -eq 0 ] |
26,13 → 29,13 |
# activation du contournement |
for i in chilli dansguardian havp mysqld radiusd httpd freshclam dnsmasq squid |
do |
if (pgrep $i) > /dev/null ; then /etc/init.d/$i stop ; fi |
if (pgrep $i) > /dev/null ; then /usr/bin/systemctl stop $i.service ; fi |
done |
echo "Configure eth1 ..." |
cp /etc/sysconfig/network-scripts/default-ifcfg-eth1 /etc/sysconfig/network-scripts/ifcfg-eth1 |
ifup eth1 |
echo "$INTIF configuration ..." |
cp /etc/sysconfig/network-scripts/default-ifcfg-$INTIF /etc/sysconfig/network-scripts/ifcfg-$INTIF |
ifup $INTIF |
sh /usr/local/bin/alcasar-iptables-bypass.sh |
echo "Configure dnsmasq ..." |
echo "dnsmasq Configuration ..." |
$SED "s?^conf-dir=.*?#&?g" /etc/dnsmasq-blacklist.conf |
$SED "s?^no-dhcp-interface=.*?#&?g" /etc/dnsmasq.conf /etc/dnsmasq-blacklist.conf |
/etc/init.d/dnsmasq start |
42,13 → 45,13 |
--off | -off) |
# désactivation du contournement |
if (pgrep dnsmasq) > /dev/null ; then /etc/init.d/dnsmasq stop ; fi |
echo "Configure dnsmasq ..." |
echo "dnsmasq Configuration ..." |
$SED "s?^#conf-dir=.*?conf-dir=/usr/local/share/dnsmasq-bl-enabled?g" /etc/dnsmasq-blacklist.conf |
$SED "s?^#no-dhcp-interface=.*?no-dhcp-interface=eth1?g" /etc/dnsmasq.conf /etc/dnsmasq-blacklist.conf |
rm -f /etc/sysconfig/network-scripts/ifcfg-eth1 |
$SED "s?^#no-dhcp-interface=.*?no-dhcp-interface=$INTIF?g" /etc/dnsmasq.conf /etc/dnsmasq-blacklist.conf |
rm -f /etc/sysconfig/network-scripts/ifcfg-$INTIF |
for i in chilli dansguardian havp mysqld radiusd httpd freshclam dnsmasq squid |
do |
if ! (pgrep $i) > /dev/null ; then /etc/init.d/$i start ; fi |
if ! (pgrep $i) > /dev/null ; then /usr/bin/systemctl start $i.service; fi |
done |
sh /usr/local/bin/alcasar-iptables.sh |
echo "L'authentification et le filtrage sont de nouveau activés" |