Subversion Repositories ALCASAR

Rev

Rev 63 | Blame | Last modification | View Log

#!/bin/sh
# $Id: alcasar-bypass.sh 348 2010-11-29 21:24:26Z franck $

# Script portail-bypass
# Permet d'activer ou de désactiver le contournement de l'authentification et du filtrage WEB
usage="Usage: alcasar-bypass.sh -on | -off"
nb_args=$#
args=$1
if [ $nb_args -eq 0 ]
then
        nb_args=1
        args="-h"
fi
case $args in
        -\? | -h* | --h*)
                echo "$usage"
                exit 0
                ;;
        -on)    
                # activation du contournement
                for i in chilli squid dansguardian httpd mysqld radiusd
                do
                        if  (pgrep $i) > /dev/null ; then /etc/init.d/$i stop ; fi
                done
                echo "Configure eth1 ..."
                ifup eth1
                sh /usr/local/bin/alcasar-iptables-bypass.sh
                if ! (pgrep dnsmasq)  > /dev/null ; then /etc/init.d/dnsmasq start ; fi
                echo "Le contournement du module d'authentification et de filtrage WEB est activé"
                echo "les journaux du parefeu continuent néanmoins d'être enregistrés"
                ;;
        -off)
                # désactivation du contournement
                if (pgrep dnsmasq) > /dev/null ; then /etc/init.d/dnsmasq stop ; fi
                for i in chilli squid dansguardian httpd mysqld radiusd
                do
                        if  ! (pgrep $i) > /dev/null ; then /etc/init.d/$i start ; fi
                done
                sh /usr/local/bin/alcasar-iptables.sh
                echo "L'authentification et le filtrage WEB sont de nouveau activés"
;;
        *)
                echo "Argument inconnu :$1";
                echo "$usage"
                exit 1
                ;;
esac